I'm implementing logfile support for Postfix on MacOS, because not
providing results in a bad experience.
This is a retrofit workaround, therefore it will have limitations
that do not exist with the default syslog-based implementation.
- The logfile pathname is configured in main.cf, and therefore the
logfile cannot contain information from programs that fail before
they finish processing main.cf and command-line options.
- The logfile is written by a new postlogd daemon. This program is
start-up critical, meaning that if the postlogd daemon fails
during "postfix start" or "postfix reload", then the Postfix
master(8) daemon will terminate.
- During Postfix start-up, before the postlogd daemon runs, programs
such as postfix(1), postlog(1) and master(8) will write directly
to the logfile. These programs will log a fatal error if they
cannot create or append to the logfile.
- The low-privilege setgid Postfix programs postqueue(1) and
postdrop(1) can send logging to the postlog daemon. If the postlog
daemon is down, the logging from these programs will be lost.
These programs will still log to stderr.
- The unprivileged Postfix sendmail(1) program cannot talk to the
postlogd daemon. This program can log only to stderr.
- Logfile rotation is not built into Postfix. To rotate the file,
run a cron job that renames the current file, and that excecutes
"postfix reload" before compressing the file. The postlogd daemon
will automatically create a logfile if it does not exist.
Wietse