From 5e61585d76ae77fd5e9e96ebabb57afa4d74880d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 14:06:34 +0200 Subject: Adding upstream version 3.5.24. Signed-off-by: Daniel Baumann --- proto/MAILLOG_README.html | 183 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 proto/MAILLOG_README.html (limited to 'proto/MAILLOG_README.html') diff --git a/proto/MAILLOG_README.html b/proto/MAILLOG_README.html new file mode 100644 index 0000000..9951c6c --- /dev/null +++ b/proto/MAILLOG_README.html @@ -0,0 +1,183 @@ + + + + + + +Postfix logging to file or stdout + + + + + + + +

Postfix +logging to file or stdout

+ +
+ +

Overview

+ +

Postfix supports it own logging system as an alternative to +syslog (which remains the default). This is available with Postfix +version 3.4 or later.

+ +

Topics covered in this document:

+ + + +

Configuring logging to file

+ +

Logging to file solves a usability problem for MacOS, and +eliminates multiple problems for systemd-based systems.

+ +
    + +
  1. Add the following line to master.cf if not already present +(note: there must be no whitespace at the start of the line):

    + +
    +
    +postlog   unix-dgram n  -       n       -       1       postlogd
    +
    +
    + +

    Note: the service type "unix-dgram" was introduced with +Postfix 3.4. Remove the above line before backing out to an older +Postfix version.

    + +
  2. Configure Postfix to write logging, to, for example, +/var/log/postfix.log. See also the "Logfile +rotation" section below for logfile management.

    + +
    +
    +# postfix stop
    +# postconf maillog_file=/var/log/postfix.log
    +# postfix start
    +
    +
    + +

    By default, the logfile name must start with "/var" or "/dev/stdout" +(the list of allowed prefixes is configured with the maillog_file_prefixes +parameter). This safety mechanism limits the damage from a single +configuration mistake.

    + +
+ +

Configuring logging to stdout

+ +

Logging to stdout is useful when Postfix runs in a container, +as it eliminates a syslogd dependency.

+ +
    + +
  1. Add the following line to master.cf if not already present (note: +there must be no whitespace at the start of the line):

    + +
    +
    +postlog   unix-dgram n  -       n       -       1       postlogd
    +
    +
    + +

    Note: the service type "unix-dgram" was introduced with +Postfix 3.4. Remove the above line before backing out to an older +Postfix version.

    + +
  2. Configure main.cf with "maillog_file = /dev/stdout".

    + +
  3. Start Postfix with "postfix start-fg".

    + +
+ +

Rotating logs

+ +

The command "postfix logrotate" may be run by hand or +by a cronjob. It logs all errors, and reports errors to stderr if +run from a terminal. This command implements the following steps: +

+ + + +

Notes:

+ + + +

Limitations

+ +

Background:

+ + + +

Limitations:

+ + + + + + -- cgit v1.2.3