Using Syslog is the new standard. It is not optional anymore.

master
Dimitri Huisman 3 years ago
parent 5c4000c279
commit 53975684b8

@ -2,11 +2,6 @@
# General
###############
{% if POSTFIX_LOG_SYSLOG != "local" %}
# Logging configuration
maillog_file = /dev/stdout
{% endif %}
# Main domain and hostname
mydomain = {{ DOMAIN }}
myhostname = {{ HOSTNAMES.split(",")[0] }}

@ -82,12 +82,11 @@ if "RELAYUSER" in os.environ:
conf.jinja("/conf/sasl_passwd", os.environ, path)
os.system("postmap {}".format(path))
if os.environ["POSTFIX_LOG_SYSLOG"] == "local":
# Configure and start local rsyslog server
conf.jinja("/conf/rsyslog.conf", os.environ, "/etc/rsyslog.conf")
os.system("/usr/sbin/rsyslogd -n &")
# Configure logrotate
if os.environ["POSTFIX_LOG_FILE"] != "":
# Configure and start local rsyslog server
conf.jinja("/conf/rsyslog.conf", os.environ, "/etc/rsyslog.conf")
os.system("/usr/sbin/rsyslogd -n &")
# Configure logrotate
if os.environ["POSTFIX_LOG_FILE"] != "":
conf.jinja("/conf/logrotate.conf", os.environ, "/etc/logrotate.d/postfix.conf")
if os.path.exists("/overrides/logrotate.conf"):
shutil.copyfile("/overrides/logrotate.conf", "/etc/logrotate.d/postfix.conf")

@ -268,9 +268,8 @@ Mail log settings
By default, all services log directly to stdout/stderr. Logs can be collected by any docker log processing solution.
Postfix writes the logs to a syslog server which logs to stdout. This is used to filter out messages from the healthcheck.
In some situations, a separate mail log is required (e.g. for legal reasons). The syslog server can be configured to write log files to a volume. It can be configured by the following options:
In some situations, a separate mail log is required (e.g. for legal reasons). The syslog server can be configured to write log files to a volume. It can be configured with the following option:
- ``POSTFIX_LOG_SYSLOG`` (default: ``local`` ): Set to ``local`` (default) to enable the syslog server. Set to ``disable`` to disable the syslog server. If disabled, Postfix will log directly to stdout and the healthcheck messages will not be filtered out.
- ``POSTFIX_LOG_FILE``: The file to log the mail log to. When enabled, the syslog server will also log to stdout.
When ``POSTFIX_LOG_FILE`` is enabled, the logrotate program will automatically rotate the logs every week and keep 52 logs.

@ -1,9 +1,6 @@
Introduces postfix logging via rsyslog with these features:
Introduces postfix logging via syslog with these features:
- stdout logging still enabled
- internal test request log messages (healthcheck) are filtered out by rsyslog
- optional logging to file via POSTFIX_LOG_FILE env variable
To use it configure in mailu.env
- ``POSTFIX_LOG_SYSLOG``: (default: ``local``) set to ``local`` (Default) to enable a local syslog server for postfix. Set to ``disable``to disable.
To use logging to file configure in mailu.env
- ``POSTFIX_LOG_FILE``: The file to log the mail log to
Not disabling POSTFIX_LOG_SYSLOG is recommended to get rid of internal healtcheck messages.

Loading…
Cancel
Save