Commit 05dd3bb1 authored by Vincent Pelletier's avatar Vincent Pelletier

stack/erp5: Setup postfix logging.

Direct logs to instance's var/log and call postfix's logrotate command,
instead of the slapos-hostile syslog.
Unfortunately, rotated logs will stay in that directory, unlike the
de-facto standard for slapos.
parent 540daf2b
Pipeline #23265 failed with stage
in 0 seconds
...@@ -50,15 +50,15 @@ md5sum = f928b9dc99f7f970caadfe7dd6f95d34 ...@@ -50,15 +50,15 @@ md5sum = f928b9dc99f7f970caadfe7dd6f95d34
[template-postfix] [template-postfix]
filename = instance-postfix.cfg.in filename = instance-postfix.cfg.in
md5sum = 88224e294b0361841614f4a31fc901c7 md5sum = 8f7bfca893a01c390df7a3dc9c2410e1
[template-postfix-master-cf] [template-postfix-master-cf]
filename = postfix_master.cf.in filename = postfix_master.cf.in
md5sum = 9ac81647368068a1a98a785d08074b43 md5sum = ef164517e3f7170d03499967d625c3bb
[template-postfix-main-cf] [template-postfix-main-cf]
filename = postfix_main.cf.in filename = postfix_main.cf.in
md5sum = f79ef8355c9f9950bc2cb17b52bc49fb md5sum = e9f03c66627beb4054d45123450162d2
[template-postfix-aliases] [template-postfix-aliases]
filename = postfix_aliases.in filename = postfix_aliases.in
...@@ -70,7 +70,7 @@ md5sum = b95084ae9eed95a68eada45e28ef0c04 ...@@ -70,7 +70,7 @@ md5sum = b95084ae9eed95a68eada45e28ef0c04
[template] [template]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 5747c487edd721d8a53061392307b55f md5sum = 2cf8721b82767c2461b5c847d281ae7b
[template-erp5] [template-erp5]
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
......
...@@ -36,6 +36,7 @@ bin = ${buildout:directory}/bin ...@@ -36,6 +36,7 @@ bin = ${buildout:directory}/bin
usr = ${buildout:directory}/usr usr = ${buildout:directory}/usr
srv = ${buildout:directory}/srv srv = ${buildout:directory}/srv
var = ${buildout:directory}/var var = ${buildout:directory}/var
var-log = ${:var}/log
var-lib = ${:var}/lib var-lib = ${:var}/lib
var-lib-postfix = ${:var-lib}/postfix var-lib-postfix = ${:var-lib}/postfix
var-spool = ${:var}/spool var-spool = ${:var}/spool
...@@ -92,6 +93,7 @@ relayhost = {{ dumps(relay.get('host')) }} ...@@ -92,6 +93,7 @@ relayhost = {{ dumps(relay.get('host')) }}
relay-sasl-credential = {{ dumps(relay.get('sasl-credential')) }} relay-sasl-credential = {{ dumps(relay.get('sasl-credential')) }}
cyrus-sasldb = ${directory:etc-cyrus}/postfix.gdbm cyrus-sasldb = ${directory:etc-cyrus}/postfix.gdbm
milter-list = {{ dumps(milter_list) }} milter-list = {{ dumps(milter_list) }}
xz-utils-location = {{ dumps(parameter_dict['xz-utils-location']) }}
[userinfo] [userinfo]
recipe = slapos.cookbook:userinfo recipe = slapos.cookbook:userinfo
...@@ -141,6 +143,16 @@ command = ...@@ -141,6 +143,16 @@ command =
update = update =
${:openssl} req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout '${:key}' -out '${:cert}' ${:openssl} req -newkey rsa -batch -new -x509 -days 3650 -nodes -keyout '${:key}' -out '${:cert}'
[{{ section('postfix-logrotate') }}]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
name = postfix-logrotate
frequency = 0 0 * * *
command = ${directory:bin}/postfix logrotate
[postfix-main-cf-parameter]
postfix-location = {{ parameter_dict['postfix-location'] }}
[{{ section('postfix-main-cf') }}] [{{ section('postfix-main-cf') }}]
< = jinja2-template-base < = jinja2-template-base
output = ${directory:etc-postfix}/main.cf output = ${directory:etc-postfix}/main.cf
...@@ -163,6 +175,8 @@ context = ...@@ -163,6 +175,8 @@ context =
key key smtpd-ssl:key key key smtpd-ssl:key
key dh_512 smtpd-ssl:dh-512 key dh_512 smtpd-ssl:dh-512
key dh_2048 smtpd-ssl:dh-2048 key dh_2048 smtpd-ssl:dh-2048
key log_directory directory:var-log
key xz_utils_location configuration:xz-utils-location
key postfix_location postfix-main-cf-parameter:postfix-location key postfix_location postfix-main-cf-parameter:postfix-location
key etc_postfix directory:etc-postfix key etc_postfix directory:etc-postfix
......
...@@ -15,6 +15,7 @@ postfix-location = {{ postfix_location }} ...@@ -15,6 +15,7 @@ postfix-location = {{ postfix_location }}
template-postfix-aliases = {{ template_postfix_aliases }} template-postfix-aliases = {{ template_postfix_aliases }}
template-postfix-main-cf = {{ template_postfix_main_cf }} template-postfix-main-cf = {{ template_postfix_main_cf }}
template-postfix-master-cf = {{ template_postfix_master_cf }} template-postfix-master-cf = {{ template_postfix_master_cf }}
xz-utils-location = {{ xz_utils_location }}
[dynamic-template-postfix] [dynamic-template-postfix]
< = jinja2-template-base < = jinja2-template-base
......
...@@ -71,3 +71,7 @@ smtp_sasl_auth_enable = yes ...@@ -71,3 +71,7 @@ smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = {{ sasl_passwd }} smtp_sasl_password_maps = {{ sasl_passwd }}
smtp_sasl_tls_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous
{%- endif %} {%- endif %}
maillog_file = {{ log_directory }}/postfix.log
maillog_file_compressor = {{ xz_utils_location }}/bin/xz
maillog_file_prefixes = {{ log_directory }}
...@@ -27,3 +27,4 @@ virtual unix - n n - - virtual ...@@ -27,3 +27,4 @@ virtual unix - n n - - virtual
lmtp unix - - n - - lmtp lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil anvil unix - - n - 1 anvil
scache unix - - n - 1 scache scache unix - - n - 1 scache
postlog unix-dgram n - n - 1 postlogd
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