Commit b9bb62c8 authored by Marco Mariani's avatar Marco Mariani

postfix: added postfix instance to erp5 stack

parent 8f9b1715
......@@ -66,6 +66,7 @@ extends =
../../component/jsl/buildout.cfg
../../component/6tunnel/buildout.cfg
../../component/findutils/buildout.cfg
../../component/postfix/buildout.cfg
parts =
rdiff-backup
......@@ -101,6 +102,7 @@ parts =
dcron
dash
wget
postfix
# Buildoutish
patched-eggs
......@@ -151,7 +153,7 @@ mode = 644
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
branch = erp5-cluster
branch = erp5-postfix
git-executable = ${git:location}/bin/git
[check-recipe]
......@@ -225,12 +227,28 @@ md5sum = 4504b8e58cf6eb0f17ef30c29c04432d
filename = instance-create-erp5-site-real.cfg.in
md5sum = ba1b23177e101b5b9f03e1c5009c81fc
[template-postfix]
< = download-base
filename = instance-postfix.cfg.in
md5sum = a1b131b5bf6a749b0c853e9577f43cca
[template-postfix-master-cf]
< = download-base
filename = postfix_master.cf.in
md5sum = 67f06ed63c5d3fa47908a83071b76bd3
[template-postfix-main-cf]
< = download-base
filename = postfix_main.cf.in
md5sum = b6f44d8507aa15d71fdff75bf3eeddb9
[template]
< = template-jinja2-base
# XXX: "template.cfg" is hardcoded in instanciation recipe
filename = template.cfg
template = ${:_profile_base_location_}/instance.cfg.in
md5sum = ed053189e234a27f0b2f2b8b53c532bf
md5sum = c0775bf7b76ec7d95e0c1ec080a89fdc
extra-context =
key mariadb_link_binary template-mariadb:link-binary
key zope_link_binary template-zope:link-binary
......@@ -271,6 +289,9 @@ extra-context =
key logrotate_location logrotate:location
key mariadb_location mariadb:location
key openssl_location openssl:location
key postfix_location postfix:location
key template_postfix_main_cf template-postfix-main-cf:target
key template_postfix_master_cf template-postfix-master-cf:target
key sixtunnel_location 6tunnel:location
key stunnel_location stunnel:location
key template_apache_conf template-apache-conf:target
......@@ -286,6 +307,7 @@ extra-context =
key template_mariadb_initial_setup template-mariadb-initial-setup:target
key template_my_cnf template-my-cnf:target
key template_neo template-neo:target
key template_postfix template-postfix:target
key template_zeo template-zeo:target
key template_zope template-zope:target
key template_zope_conf template-zope-conf:target
......@@ -295,7 +317,7 @@ extra-context =
[template-erp5]
< = download-base
filename = instance-erp5.cfg.in
md5sum = 66c338cd82c89a3217f4576429661a51
md5sum = 185c649279e9a88f109532444712c0a9
[template-neo]
< = download-base
......
......@@ -43,6 +43,7 @@ config-{{ option }} = {{ dumps(value) }}
{{ request('memcached-volatile', 'kumofs', 'memcached', {'tcpv4-port': 2010, 'ram-storage-size': 64}) }}
{{ request('cloudooo', 'cloudooo', 'cloudooo', {'tcpv4-port': 2020}) }}
{{ request('mariadb', 'mariadb', 'mariadb', {'tcpv4-port': 2099}, {'database-list': True, 'test-database-list': True}) }}
{{ request('postfix', 'postfix', 'postfix', {'tcpv4-port': 2025}) }}
{# Fail early if an unexpected value is provided -#}
{% set possible_software_type_dict = {'zeo': 'zeo', 'neo': 'neo'} -%}
{{ request('zodb', 'zodb-' ~ possible_software_type_dict[slapparameter_dict.get('zodb-software-type', 'zeo')], 'zodb', {'tcpv4-port': 2100, 'zodb-dict': {'root': {}}}, {'zodb-storage-type': False, 'zodb-dict': False, 'tidstorage-ip': False, 'tidstorage-port': False}) }}
......
{% if software_type == slap_software_type -%}
{% set part_list = [] -%}
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
{% set ipv4 = (ipv4_set | list)[0] -%}
{% set tcpv4_port = slapparameter_dict['tcpv4-port'] -%}
[buildout]
parts =
publish-postfix-connection-information
postfix-main-cf
postfix-master-cf
postfix-symlinks-bin
postfix-symlinks-sbin
postfix-symlinks-libexec
service-postfix-master
sh-postfix-environment
newaliases
{{ part_list | join('\n ') }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
[publish-postfix-connection-information]
recipe = slapos.cookbook:publish.serialised
url = smtp://${:ipv4}:${:port}/
ipv4 = {{ ipv4 }}
port = ${postfix-master-cf-parameters:smtp_port}
[directory]
recipe = slapos.cookbook:mkdirectory
etc = ${buildout:directory}/etc
etc_postfix = ${:etc}/postfix
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
usr = ${buildout:directory}/usr
usr_bin = ${:usr}/bin
usr_sbin = ${:usr}/sbin
var = ${buildout:directory}/var
var_spool = ${:var}/spool
var_spool_postfix = ${:var_spool}/postfix
var_spool_postfix_active = ${:var_spool_postfix}/active
var_spool_postfix_bounce = ${:var_spool_postfix}/bounce
var_spool_postfix_corrupt = ${:var_spool_postfix}/corrupt
var_spool_postfix_defer = ${:var_spool_postfix}/defer
var_spool_postfix_deferred = ${:var_spool_postfix}/deferred
var_spool_postfix_flush = ${:var_spool_postfix}/flush
var_spool_postfix_hold = ${:var_spool_postfix}/hold
var_spool_postfix_incoming = ${:var_spool_postfix}/incoming
var_spool_postfix_maildrop = ${:var_spool_postfix}/maildrop
var_spool_postfix_pid = ${:var_spool_postfix}/pid
var_spool_postfix_private = ${:var_spool_postfix}/private
var_spool_postfix_public = ${:var_spool_postfix}/public
var_spool_postfix_saved = ${:var_spool_postfix}/saved
var_spool_postfix_trace = ${:var_spool_postfix}/trace
var_lib = ${:var}/lib
var_mail = ${:var}/mail
var_lib_postfix = ${:var_lib}/postfix
[userinfo]
recipe = slapos.cookbook:userinfo
[postfix-main-cf]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc_postfix}/main.cf
template = {{ parameter_dict['template-postfix-main-cf'] }}
context =
raw queue_directory ${directory:var_spool_postfix}
raw command_directory ${directory:usr_sbin}
raw daemon_directory {{ parameter_dict['postfix-location'] }}/usr/libexec/postfix
raw data_directory ${directory:var_lib_postfix}
raw mail_owner ${userinfo:pw_name}
raw alias_database hash:${aliases:rendered}
raw alias_maps hash:${aliases:rendered}, nis:mail.aliases
raw mail_spool_directory ${directory:var_mail}
raw mydomain localdomain
raw myhostname test.localdomain
raw setgid_group ${userinfo:gr_name}
raw inet_interfaces {{ ipv4 }}
[postfix-master-cf-parameters]
smtp_port = {{ tcpv4_port }}
[postfix-master-cf]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc_postfix}/master.cf
template = {{ parameter_dict['template-postfix-master-cf'] }}
context = section parameter_dict postfix-master-cf-parameters
[aliases]
recipe = slapos.recipe.template:jinja2
template = inline:
# See http://www.postfix.org/aliases.5.html for format
rendered = ${directory:etc_postfix}/aliases
mode = 644
[newaliases]
recipe = plone.recipe.command
stop-on-error = true
command =
MAIL_CONFIG="${directory:etc_postfix}" {{ parameter_dict['postfix-location'] }}/usr/bin/newaliases
update-command = ${:command}
[postfix-symlinks-bin]
recipe = slapos.cookbook:symbolic.link
target-directory = ${directory:usr_bin}
link-binary =
{{ parameter_dict['postfix-location'] }}/usr/bin/mailq
{{ parameter_dict['postfix-location'] }}/usr/bin/newaliases
[postfix-symlinks-sbin]
recipe = slapos.cookbook:symbolic.link
target-directory = ${directory:usr_sbin}
link-binary =
{{ parameter_dict['postfix-location'] }}/usr/sbin/postalias
{{ parameter_dict['postfix-location'] }}/usr/sbin/postcat
{{ parameter_dict['postfix-location'] }}/usr/sbin/postconf
{{ parameter_dict['postfix-location'] }}/usr/sbin/postdrop
{{ parameter_dict['postfix-location'] }}/usr/sbin/postfix
{{ parameter_dict['postfix-location'] }}/usr/sbin/postkick
{{ parameter_dict['postfix-location'] }}/usr/sbin/postlock
{{ parameter_dict['postfix-location'] }}/usr/sbin/postlog
{{ parameter_dict['postfix-location'] }}/usr/sbin/postmap
{{ parameter_dict['postfix-location'] }}/usr/sbin/postmulti
{{ parameter_dict['postfix-location'] }}/usr/sbin/postqueue
{{ parameter_dict['postfix-location'] }}/usr/sbin/postsuper
{{ parameter_dict['postfix-location'] }}/usr/sbin/sendmail
[postfix-symlinks-libexec]
recipe = slapos.cookbook:symbolic.link
target-directory = ${directory:usr}
link-binary =
{{ parameter_dict['postfix-location'] }}/usr/libexec
[service-postfix-master]
recipe = slapos.cookbook:wrapper
command-line = {{ parameter_dict['postfix-location'] }}/usr/libexec/postfix/master
wrapper-path = ${directory:service}/start-postfix-master
environment = MAIL_CONFIG=${directory:etc_postfix}
[postfix-environment]
MAIL_CONFIG=${directory:etc_postfix}
[sh-postfix-environment]
recipe = slapos.recipe.template:jinja2
template = inline:
export MAIL_CONFIG="${directory:etc_postfix}"
rendered = ${buildout:directory}/postfix-environment.sh
context =
section postfix_environment postfix-environment
mode = 755
{% endif %}
......@@ -61,6 +61,22 @@ extra-context =
section parameter_dict dynamic-template-cloudooo-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type cloudooo
[dynamic-template-postfix-parameters]
postfix-location = {{ postfix_location }}
template-postfix-main-cf = {{ template_postfix_main_cf }}
template-postfix-master-cf = {{ template_postfix_master_cf }}
[dynamic-template-postfix]
< = jinja2-template-base
template = {{ template_postfix }}
filename = instance-postfix.cfg
extensions = jinja2.ext.do
extra-context =
section parameter_dict dynamic-template-postfix-parameters
# Must match the key id in [switch-softwaretype] which uses this section.
raw software_type postfix
[dynamic-template-erp5-parameters]
local-bt5-repository = {{ local_bt5_repository }}
......@@ -247,6 +263,7 @@ kumofs = ${dynamic-template-kumofs:rendered}
cloudooo = ${dynamic-template-cloudooo:rendered}
mariadb = ${dynamic-template-mariadb:rendered}
balancer = ${dynamic-template-balancer:rendered}
postfix = ${dynamic-template-postfix:rendered}
zodb-neo = ${dynamic-template-neo:rendered}
zodb-zeo = ${dynamic-template-zeo:rendered}
zope = ${dynamic-template-zope:rendered}
# http://www.postfix.org/STANDARD_CONFIGURATION_README.html
# http://www.postfix.org/postconf.5.html
queue_directory = {{ queue_directory }}
command_directory = {{ command_directory }}
daemon_directory = {{ daemon_directory }}
data_directory = {{ data_directory }}
mail_owner = {{ mail_owner }}
myhostname = {{ myhostname }}
mydomain = {{ mydomain }}
unknown_local_recipient_reject_code = 550
alias_maps = {{ alias_maps }}
alias_database = {{ alias_database }}
mail_spool_directory = {{ mail_spool_directory }}
debug_peer_level = 2
sendmail_path =
newaliases_path =
mailq_path =
setgid_group = {{ setgid_group }}
html_directory =
manpage_directory =
sample_directory =
readme_directory =
inet_protocols = ipv4
inet_interfaces = {{ inet_interfaces }}
{% set smtp = parameter_dict['smtp_port'] -%}
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
{{smtp}} inet n - n - - smtpd
#submission inet n - n - - smtpd
pickup unix n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment