You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-06-15 00:05:11 +02:00
Using Syslog is the new standard. It is not optional anymore.
This commit is contained in:
@ -2,11 +2,6 @@
|
|||||||
# General
|
# General
|
||||||
###############
|
###############
|
||||||
|
|
||||||
{% if POSTFIX_LOG_SYSLOG != "local" %}
|
|
||||||
# Logging configuration
|
|
||||||
maillog_file = /dev/stdout
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
# Main domain and hostname
|
# Main domain and hostname
|
||||||
mydomain = {{ DOMAIN }}
|
mydomain = {{ DOMAIN }}
|
||||||
myhostname = {{ HOSTNAMES.split(",")[0] }}
|
myhostname = {{ HOSTNAMES.split(",")[0] }}
|
||||||
|
@ -82,15 +82,14 @@ if "RELAYUSER" in os.environ:
|
|||||||
conf.jinja("/conf/sasl_passwd", os.environ, path)
|
conf.jinja("/conf/sasl_passwd", os.environ, path)
|
||||||
os.system("postmap {}".format(path))
|
os.system("postmap {}".format(path))
|
||||||
|
|
||||||
if os.environ["POSTFIX_LOG_SYSLOG"] == "local":
|
# Configure and start local rsyslog server
|
||||||
# Configure and start local rsyslog server
|
conf.jinja("/conf/rsyslog.conf", os.environ, "/etc/rsyslog.conf")
|
||||||
conf.jinja("/conf/rsyslog.conf", os.environ, "/etc/rsyslog.conf")
|
os.system("/usr/sbin/rsyslogd -n &")
|
||||||
os.system("/usr/sbin/rsyslogd -n &")
|
# Configure logrotate
|
||||||
# Configure logrotate
|
if os.environ["POSTFIX_LOG_FILE"] != "":
|
||||||
if os.environ["POSTFIX_LOG_FILE"] != "":
|
conf.jinja("/conf/logrotate.conf", os.environ, "/etc/logrotate.d/postfix.conf")
|
||||||
conf.jinja("/conf/logrotate.conf", os.environ, "/etc/logrotate.d/postfix.conf")
|
if os.path.exists("/overrides/logrotate.conf"):
|
||||||
if os.path.exists("/overrides/logrotate.conf"):
|
shutil.copyfile("/overrides/logrotate.conf", "/etc/logrotate.d/postfix.conf")
|
||||||
shutil.copyfile("/overrides/logrotate.conf", "/etc/logrotate.d/postfix.conf")
|
|
||||||
|
|
||||||
# Run Podop and Postfix
|
# Run Podop and Postfix
|
||||||
multiprocessing.Process(target=start_podop).start()
|
multiprocessing.Process(target=start_podop).start()
|
||||||
|
@ -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.
|
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.
|
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.
|
- ``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.
|
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
|
- stdout logging still enabled
|
||||||
- internal test request log messages (healthcheck) are filtered out by rsyslog
|
- internal test request log messages (healthcheck) are filtered out by rsyslog
|
||||||
- optional logging to file via POSTFIX_LOG_FILE env variable
|
- optional logging to file via POSTFIX_LOG_FILE env variable
|
||||||
To use it configure in mailu.env
|
To use logging to file 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.
|
|
||||||
- ``POSTFIX_LOG_FILE``: The file to log the mail log to
|
- ``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.
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user