From b8f485636ac7ecd8cc7bc7d403c227fba0bedca3 Mon Sep 17 00:00:00 2001
From: Wietse Venema
Date: Tue, 29 Jan 2019 00:00:00 -0500
Subject: [PATCH] postfix-3.4-20190129
---
postfix/.indent.pro | 3 +-
postfix/HISTORY | 62 +++
postfix/Makefile.in | 2 +-
postfix/RELEASE_NOTES | 79 +++
postfix/WISHLIST | 5 +
postfix/conf/master.cf | 1 +
postfix/conf/post-install | 10 +
postfix/conf/postfix-files | 3 +
postfix/conf/postfix-script | 16 +-
postfix/html/Makefile.in | 6 +-
postfix/html/master.5.html | 101 ++--
postfix/html/master.8.html | 73 +--
postfix/html/postconf.5.html | 49 +-
postfix/html/postdrop.1.html | 12 +-
postfix/html/postfix-manuals.html | 2 +
postfix/html/postfix.1.html | 69 ++-
postfix/html/postlog.1.html | 42 +-
postfix/html/postlogd.8.html | 87 ++++
postfix/html/postmulti.1.html | 5 +
postfix/man/Makefile.in | 7 +-
postfix/man/man1/postdrop.1 | 10 +-
postfix/man/man1/postfix.1 | 17 +
postfix/man/man1/postlog.1 | 18 +-
postfix/man/man1/postmulti.1 | 5 +
postfix/man/man5/master.5 | 19 +-
postfix/man/man5/postconf.5 | 31 +-
postfix/man/man8/master.8 | 12 +-
postfix/man/man8/postlogd.8 | 92 ++++
postfix/mantools/postlink | 6 +
postfix/proto/master | 19 +-
postfix/proto/postconf.proto | 37 +-
postfix/src/global/Makefile.in | 27 +-
postfix/src/global/mail_params.c | 10 +-
postfix/src/global/mail_params.h | 19 +-
postfix/src/global/mail_proto.h | 1 +
postfix/src/global/mail_task.c | 33 +-
postfix/src/global/mail_version.h | 2 +-
postfix/src/global/maillog_client.c | 278 +++++++++++
postfix/src/global/maillog_client.h | 33 ++
postfix/src/master/Makefile.in | 55 +-
postfix/src/master/dgram_server.c | 663 +++++++++++++++++++++++++
postfix/src/master/event_server.c | 14 +-
postfix/src/master/mail_server.h | 8 +
postfix/src/master/master.c | 33 +-
postfix/src/master/master.h | 3 +-
postfix/src/master/master_ent.c | 13 +
postfix/src/master/master_listen.c | 16 +
postfix/src/master/master_proto.h | 6 +
postfix/src/master/master_wakeup.c | 10 +
postfix/src/master/multi_server.c | 14 +-
postfix/src/master/single_server.c | 11 +-
postfix/src/master/trigger_server.c | 14 +-
postfix/src/postalias/Makefile.in | 2 +-
postfix/src/postalias/postalias.c | 18 +-
postfix/src/postconf/postconf_master.c | 1 +
postfix/src/postdrop/Makefile.in | 2 +-
postfix/src/postdrop/postdrop.c | 32 +-
postfix/src/postfix/Makefile.in | 2 +-
postfix/src/postfix/postfix.c | 49 +-
postfix/src/postkick/postkick.c | 5 +-
postfix/src/postlog/Makefile.in | 2 +-
postfix/src/postlog/postlog.c | 31 +-
postfix/src/postlogd/Makefile.in | 74 +++
postfix/src/postlogd/postlogd.c | 251 ++++++++++
postfix/src/postmap/Makefile.in | 2 +-
postfix/src/postmap/postmap.c | 10 +-
postfix/src/postmulti/Makefile.in | 2 +-
postfix/src/postmulti/postmulti.c | 28 +-
postfix/src/postqueue/Makefile.in | 2 +-
postfix/src/postqueue/postqueue.c | 13 +-
postfix/src/postsuper/Makefile.in | 2 +-
postfix/src/postsuper/postsuper.c | 8 +-
postfix/src/sendmail/Makefile.in | 2 +-
postfix/src/sendmail/sendmail.c | 13 +-
postfix/src/tls/Makefile.in | 9 +-
postfix/src/util/Makefile.in | 52 +-
postfix/src/util/connect.h | 6 +
postfix/src/util/listen.h | 1 +
postfix/src/util/logwriter.c | 124 +++++
postfix/src/util/logwriter.h | 38 ++
postfix/src/util/msg_logger.c | 347 +++++++++++++
postfix/src/util/msg_logger.h | 60 +++
postfix/src/util/msg_output.c | 69 ++-
postfix/src/util/msg_output.h | 6 +-
postfix/src/util/msg_syslog.c | 56 ++-
postfix/src/util/msg_syslog.h | 8 +-
postfix/src/util/unix_dgram_connect.c | 90 ++++
postfix/src/util/unix_dgram_listen.c | 93 ++++
postfix/src/util/watchdog.c | 7 +
89 files changed, 3287 insertions(+), 393 deletions(-)
create mode 100644 postfix/html/postlogd.8.html
create mode 100644 postfix/man/man8/postlogd.8
create mode 100644 postfix/src/global/maillog_client.c
create mode 100644 postfix/src/global/maillog_client.h
create mode 100644 postfix/src/master/dgram_server.c
create mode 100644 postfix/src/postlogd/Makefile.in
create mode 100644 postfix/src/postlogd/postlogd.c
create mode 100644 postfix/src/util/logwriter.c
create mode 100644 postfix/src/util/logwriter.h
create mode 100644 postfix/src/util/msg_logger.c
create mode 100644 postfix/src/util/msg_logger.h
create mode 100644 postfix/src/util/unix_dgram_connect.c
create mode 100644 postfix/src/util/unix_dgram_listen.c
diff --git a/postfix/.indent.pro b/postfix/.indent.pro
index 531e12c1c..7e977406b 100644
--- a/postfix/.indent.pro
+++ b/postfix/.indent.pro
@@ -176,6 +176,7 @@
-TLMTP_STATE
-TLOCAL_EXP
-TLOCAL_STATE
+-TLOGWRITER
-TLONG_NAME_MASK
-TMAC_EXP_CONTEXT
-TMAC_EXP_OP_INFO
@@ -399,6 +400,7 @@
-Tgeneral_name_stack_t
-Tiana_digest
-Toff_t
+-Tpem_load_state_t
-Tregex_t
-Tregmatch_t
-Tsasl_conn_t
@@ -413,4 +415,3 @@
-Ttime_t
-Ttlsa_filter
-Tx509_stack_t
--Tpem_load_state_t
diff --git a/postfix/HISTORY b/postfix/HISTORY
index 4a4958894..bfdb67446 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -23946,7 +23946,69 @@ Apologies for any names omitted.
dict_open.c, and updated the -F description in the postmap
manpage. Files: util/dict_open.c, postmap/postmap.c.
+20190121
+
+ Logging: support for internal logging file, without using
+ syslog (it uses the new postlogd daemon instead). This
+ solves a usability problem for MacOS, may help getting
+ around systemd, and solves 99% of the problem for logging
+ to stdout in a container (hopefully we have 100% soon).
+ Enable by setting, for example, "maillog_file =
+ /var/log/postfix.log"). This works fine for daemons, and
+ with some limitations for non-daemon programs. See
+ RELEASE_NOTES for more details. Files: conf/master.cf,
+ conf/post-install, conf/postfix-files, conf/postfix-script,
+ mantools/postlink, proto/master, proto/postconf.proto,
+ global/mail_params.c, global/mail_params.h, global/mail_proto.h,
+ global/maillog_client.c, global/maillog_client.h,
+ master/dgram_server.c, master/event_server.c, master/mail_server.h,
+ master/master.c, master/master.h, master/master_ent.c,
+ master/master_listen.c, master/master_proto.h,
+ master/master_wakeup.c, master/multi_server.c,
+ master/single_server.c, master/trigger_server.c,
+ postalias/postalias.c, postconf/postconf_master.c,
+ postdrop/postdrop.c, postfix/postfix.c, postkick/postkick.c,
+ postlog/postlog.c, postlogd/postlogd.c, postmap/postmap.c,
+ postmulti/postmulti.c, postqueue/postqueue.c,
+ postsuper/postsuper.c, sendmail/sendmail.c, util/connect.h,
+ util/listen.h, util/logwriter.c, util/logwriter.h,
+ util/msg_logger.c, util/msg_logger.h, util/msg_output.c,
+ util/msg_output.h, util/unix_dgram_connect.c,
+ util/unix_dgram_listen.c.
+
+ Safety: temporary postlogd fix to avoid recursion when main.cf
+ has "maillog_file =" but master(8) still still tells its child
+ processes to send logs to postlogd. File: postlogd/postlogd.c.
+
+20190126
+
+ Safety: Postfix programs will log to either syslog or postlog
+ but not both; and postlogd forwards postlog logging to
+ syslog, when a configuration change removes the maillog_file
+ pathname, but some programs still use the old configuration.
+ Files: util/msg_syslog.[hc], util/msg_logger.c,
+ global/maillog_client.c, postlogd/postlogd.c,
+
+ Bugfix (introduced: Postfix 20110109, Postfix 2.10): watchdog
+ pipe file descriptor leak. This pipe provides one source
+ of liveness, data from this pipe is discarded, and therefore
+ this does not enable privilege escalation or DOS. File:
+ util/watchdog.c.
+
+ Feature: stdout logging support; requires "postfix start-fg"
+ and "maillog_file = /dev/stdout". Files: master/master.c,
+ conf/postfix-script.
+
20190127
+ Safety: when maillog_file is specified, 'postfix check' now
+ requires that the postlog service is enabled in master.cf.
+ Otherwise 'postfix start' etc. will log a fatal error. File:
+ conf/postfix-script.
+
Documentation: added policy_context example. File:
proto/SMTPD_POLICY_README.html.
+
+20190128
+
+ Testing: run libtls tests under Valgrind. File tls/Makefile.in.
diff --git a/postfix/Makefile.in b/postfix/Makefile.in
index f7c43fcc0..fa12b0443 100644
--- a/postfix/Makefile.in
+++ b/postfix/Makefile.in
@@ -10,7 +10,7 @@ DIRS = src/util src/global src/dns src/tls src/xsasl src/master src/milter \
src/postsuper src/qmqpd src/spawn src/flush src/verify \
src/virtual src/proxymap src/anvil src/scache src/discard src/tlsmgr \
src/postmulti src/postscreen src/dnsblog src/tlsproxy \
- src/posttls-finger
+ src/posttls-finger src/postlogd
MANDIRS = proto man html
LIBEXEC = libexec/post-install libexec/postfix-script libexec/postfix-wrapper \
libexec/postmulti-script libexec/postfix-tls-script
diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES
index 084382ba5..c87676085 100644
--- a/postfix/RELEASE_NOTES
+++ b/postfix/RELEASE_NOTES
@@ -30,6 +30,85 @@ Major changes with snapshot 20190127
[TODO: summary of SNI and chain-file support]
+Incompatible changes with snapshot 20190126-nonprod
+====================================================
+
+This introduces a new master.cf service type 'unix-dgram' that is
+used by the new postlogd(8) daemon. This type is not supported by
+older Postfix versions. Before backing out to an Postfix 3.3 or
+earlier, edit the master.cf file and remove the postlog entry.
+
+Major changes with snapshot 20190126-nonprod
+============================================
+
+Support for logging to file or stdout. This disables syslog logging.
+
+- Logging to file solves a usability problem for MacOS users, and
+ may also be useful on LINUX when systemd is getting in the way.
+
+- Logging to stdout is useful when Postfix runs in a container, as
+ it eliminates a syslogd dependency.
+
+To enable Postfix logging to file or stdout:
+--------------------------------------------
+
+Add the following line to master.cf (no whitespace at the start of the line):
+ postlog unix-dgram n - n - 1 postlogd
+
+To write logs to Postfix logfile:
+ # postfix stop
+ # postconf maillog_file=/var/log/postfix.log
+ # postfix start
+
+To write logs to stdout, typically while Postfix runs in a container:
+ # postconf maillog_file=/dev/stdout
+ # postfix start-fg
+
+To rotate a Postfix logfile with a daily cronjob:
+-------------------------------------------------
+
+The following applies when the maillog_file parameter specifies a
+reguar file.
+
+- Rename the current logfile in the same directory, appending the
+ current date to file file name. The following adds a suffix
+ of the form YYYYMMDD to file name:
+ # mv postfix.log postfix.log.$(date +%Y%M%d)
+
+- DO NOT YET COMPRESS THE FILE. POSTFIX STILL WRITES TO IT.
+
+- Reload Postfix, so that postlogd(8) will start writing to a new
+ file:
+ # postfix reload
+
+- Compress the old file, and move it elsewhere if needed.
+
+Limitations of logging to Postfix logfile or stdout:
+----------------------------------------------------
+
+Background:
+
+- Logging to Postfix logfile or stdout requires the Postfix postlogd(8)
+ service. This program ensures that simultaneous logging from
+ different programs will not get mixed up.
+
+Limitations:
+
+- Non-daemon Postfix programs may log to syslogd(8) before they
+ have processed command-line options and main.cf parameters.
+
+- If Postfix is down, the non-daemon programs postfix(1), postsuper(1),
+ postmulti(1), and postlog(1), will log directly to $maillog_file.
+ These programs expect to run with root privileges, for example
+ during Postfix start-up, reload, or shutdown.
+
+- Other non-daemon Postfix programs will never write directly to
+ $maillog_file (also, logging to stdout would interfere with the
+ operation of some of these programs). These programs can log to
+ postlogd(8) if they are run by the super-user, or if their
+ executable file has set-gid permission. Do not set this permision
+ on programs other than postdrop(1) and postqueue(1).
+
Major changes with snapshot 20180826
====================================
diff --git a/postfix/WISHLIST b/postfix/WISHLIST
index 67a0abb8e..8d486fab0 100644
--- a/postfix/WISHLIST
+++ b/postfix/WISHLIST
@@ -1,5 +1,10 @@
Wish list:
+ Add maillog_file to postfix(1) exports?
+
+ postfix rotate-log command: mv postfix.log postfix.log.$(date
+ +%Y%M%d-%H%M%S) to avoid data loss if called repeatedly.
+
In smtpd(8) and postscreen(8), set the ehlo_discard_mask
to ~0 so that STARTTLS, BDAT, DSN, etc. work only for clients
that send EHLO.
diff --git a/postfix/conf/master.cf b/postfix/conf/master.cf
index 5a75ae576..c0f250803 100644
--- a/postfix/conf/master.cf
+++ b/postfix/conf/master.cf
@@ -64,6 +64,7 @@ virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
+postlog unix-dgram n - n - 1 postlogd
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
diff --git a/postfix/conf/post-install b/postfix/conf/post-install
index 25ef7e691..975266b8b 100644
--- a/postfix/conf/post-install
+++ b/postfix/conf/post-install
@@ -887,6 +887,16 @@ EOF
# permit_mynetworks permit_sasl_authenticated \
# defer_unauth_destination" || exit 1
# }
+
+ # Postfix 3.4
+ # Add a postlog service entry.
+
+ grep '^postlog' $config_directory/master.cf >/dev/null || {
+ echo Editing $config_directory/master.cf, adding missing entry for postlog unix-domain datagram service
+ cat >>$config_directory/master.cf </dev/null \
+ | grep . >/dev/null || {
+ $FATAL "missing 'postlog' service in master.cf - run 'postfix upgrade-configuration'"
+ exit 1
+ }
+ }
+
# See if all queue files are in the right place. This is slow.
# We must scan all queues for mis-named queue files before the
# mail system can run.
diff --git a/postfix/html/Makefile.in b/postfix/html/Makefile.in
index ecf0961be..c5481f8af 100644
--- a/postfix/html/Makefile.in
+++ b/postfix/html/Makefile.in
@@ -8,7 +8,7 @@ DAEMONS = bounce.8.html cleanup.8.html defer.8.html error.8.html local.8.html \
oqmgr.8.html spawn.8.html flush.8.html virtual.8.html qmqpd.8.html \
trace.8.html verify.8.html proxymap.8.html anvil.8.html \
scache.8.html discard.8.html tlsmgr.8.html postscreen.8.html \
- dnsblog.8.html tlsproxy.8.html
+ dnsblog.8.html tlsproxy.8.html postlogd.8.html
COMMANDS= mailq.1.html newaliases.1.html postalias.1.html postcat.1.html \
postconf.1.html postfix.1.html postkick.1.html postlock.1.html \
postlog.1.html postdrop.1.html postmap.1.html postmulti.1.html \
@@ -101,6 +101,10 @@ pipe.8.html: ../src/pipe/pipe.c
PATH=../mantools:$$PATH; \
srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
+postlogd.8.html: ../src/postlogd/postlogd.c
+ PATH=../mantools:$$PATH; \
+ srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
+
postscreen.8.html: ../src/postscreen/postscreen.c
PATH=../mantools:$$PATH; \
srctoman $? | $(AWK) | $(NROFF) -man | uniq | $(MAN2HTML) | postlink >$@
diff --git a/postfix/html/master.5.html b/postfix/html/master.5.html
index 626164b62..4e488fc02 100644
--- a/postfix/html/master.5.html
+++ b/postfix/html/master.5.html
@@ -81,8 +81,8 @@ MASTER(5) MASTER(5)
hard-coding loopback IP address information in master.cf
or in main.cf.
- unix The service listens on a UNIX-domain socket and is acces-
- sible for local clients only.
+ unix The service listens on a UNIX-domain stream socket and is
+ accessible for local clients only.
The service name is a pathname relative to the Postfix
queue directory (pathname controlled with the
@@ -91,29 +91,38 @@ MASTER(5) MASTER(5)
On Solaris 8 and earlier systems the unix type is imple-
mented with streams sockets.
- fifo The service listens on a FIFO (named pipe) and is acces-
- sible for local clients only.
+ unix-dgram
+ The service listens on a UNIX-domain datagram socket and
+ is accessible for local clients only.
The service name is a pathname relative to the Postfix
queue directory (pathname controlled with the
queue_directory configuration parameter in main.cf).
- pass The service listens on a UNIX-domain socket, and is
- accessible to local clients only. It receives one open
- connection (file descriptor passing) per connection
- request.
+ fifo (obsolete)
+ The service listens on a FIFO (named pipe) and is acces-
+ sible for local clients only.
The service name is a pathname relative to the Postfix
queue directory (pathname controlled with the
queue_directory configuration parameter in main.cf).
- On Solaris 8 and earlier systems the pass type is imple-
+ pass The service listens on a UNIX-domain stream socket, and
+ is accessible to local clients only. It receives one open
+ connection (file descriptor passing) per connection
+ request.
+
+ The service name is a pathname relative to the Postfix
+ queue directory (pathname controlled with the
+ queue_directory configuration parameter in main.cf).
+
+ On Solaris 8 and earlier systems the pass type is imple-
mented with streams sockets.
This feature is available as of Postfix version 2.5.
Private (default: y)
- Whether or not access is restricted to the mail system. Inter-
+ Whether or not access is restricted to the mail system. Inter-
net (type inet) services can't be private.
Unprivileged (default: y)
@@ -121,80 +130,80 @@ MASTER(5) MASTER(5)
the Postfix system (the owner name is controlled by the
mail_owner configuration variable in the main.cf file).
- The local(8), pipe(8), spawn(8), and virtual(8) daemons require
+ The local(8), pipe(8), spawn(8), and virtual(8) daemons require
privileges.
Chroot (default: Postfix >= 3.0: n, Postfix <3.0: y)
- Whether or not the service runs chrooted to the mail queue
+ Whether or not the service runs chrooted to the mail queue
directory (pathname is controlled by the queue_directory config-
uration variable in the main.cf file).
- Chroot should not be used with the local(8), pipe(8), spawn(8),
+ Chroot should not be used with the local(8), pipe(8), spawn(8),
and virtual(8) daemons. Although the proxymap(8) server can run
- chrooted, doing so defeats most of the purpose of having that
+ chrooted, doing so defeats most of the purpose of having that
service in the first place.
The files in the examples/chroot-setup subdirectory of the Post-
- fix source show how to set up a Postfix chroot environment on a
- variety of systems. See also BASIC_CONFIGURATION_README for
+ fix source show how to set up a Postfix chroot environment on a
+ variety of systems. See also BASIC_CONFIGURATION_README for
issues related to running daemons chrooted.
Wake up time (default: 0)
Automatically wake up the named service after the specified num-
- ber of seconds. The wake up is implemented by connecting to the
- service and sending a wake up request. A ? at the end of the
- wake-up time field requests that no wake up events be sent
+ ber of seconds. The wake up is implemented by connecting to the
+ service and sending a wake up request. A ? at the end of the
+ wake-up time field requests that no wake up events be sent
before the first time a service is used. Specify 0 for no auto-
matic wake up.
- The pickup(8), qmgr(8) and flush(8) daemons require a wake up
+ The pickup(8), qmgr(8) and flush(8) daemons require a wake up
timer.
Process limit (default: $default_process_limit)
- The maximum number of processes that may execute this service
+ The maximum number of processes that may execute this service
simultaneously. Specify 0 for no process count limit.
- NOTE: Some Postfix services must be configured as a sin-
- gle-process service (for example, qmgr(8)) and some services
- must be configured with no process limit (for example,
+ NOTE: Some Postfix services must be configured as a sin-
+ gle-process service (for example, qmgr(8)) and some services
+ must be configured with no process limit (for example,
cleanup(8)). These limits must not be changed.
Command name + arguments
- The command to be executed. Characters that are special to the
- shell such as ">" or "|" have no special meaning here, and
- quotes cannot be used to protect arguments containing white-
- space. To protect whitespace, use "{" and "}" as described
+ The command to be executed. Characters that are special to the
+ shell such as ">" or "|" have no special meaning here, and
+ quotes cannot be used to protect arguments containing white-
+ space. To protect whitespace, use "{" and "}" as described
below.
- The command name is relative to the Postfix daemon directory
- (pathname is controlled by the daemon_directory configuration
+ The command name is relative to the Postfix daemon directory
+ (pathname is controlled by the daemon_directory configuration
variable).
- The command argument syntax for specific commands is specified
+ The command argument syntax for specific commands is specified
in the respective daemon manual page.
- The following command-line options have the same effect for all
+ The following command-line options have the same effect for all
daemon programs:
- -D Run the daemon under control by the command specified
+ -D Run the daemon under control by the command specified
with the debugger_command variable in the main.cf config-
uration file. See DEBUG_README for hints and tips.
-o { name = value } (long form, Postfix >= 3.0)
-o name=value (short form)
- Override the named main.cf configuration parameter. The
- parameter value can refer to other parameters as $name
- etc., just like in main.cf. See postconf(5) for syntax.
+ Override the named main.cf configuration parameter. The
+ parameter value can refer to other parameters as $name
+ etc., just like in main.cf. See postconf(5) for syntax.
- NOTE 1: With the "long form" shown above, whitespace
- after "{", around "=", and before "}" is ignored, and
+ NOTE 1: With the "long form" shown above, whitespace
+ after "{", around "=", and before "}" is ignored, and
whitespace within the parameter value is preserved.
NOTE 2: with the "short form" shown above, do not specify
- whitespace around the "=" or in parameter values. To
- specify a parameter value that contains whitespace, use
- the long form described above, or use commas instead of
+ whitespace around the "=" or in parameter values. To
+ specify a parameter value that contains whitespace, use
+ the long form described above, or use commas instead of
spaces, or specify the value in main.cf. Example:
/etc/postfix/master.cf:
@@ -205,18 +214,18 @@ MASTER(5) MASTER(5)
submission_xxx_yyy = text with whitespace...
NOTE 3: Over-zealous use of parameter overrides makes the
- Postfix configuration hard to understand and maintain.
- At a certain point, it might be easier to configure mul-
+ Postfix configuration hard to understand and maintain.
+ At a certain point, it might be easier to configure mul-
tiple instances of Postfix, instead of configuring multi-
ple personalities via master.cf.
- -v Increase the verbose logging level. Specify multiple -v
- options to make a Postfix daemon process increasingly
+ -v Increase the verbose logging level. Specify multiple -v
+ options to make a Postfix daemon process increasingly
verbose.
Other command-line arguments
Specify "{" and "}" around command arguments that contain
- whitespace (Postfix 3.0 and later). Whitespace after "{"
+ whitespace (Postfix 3.0 and later). Whitespace after "{"
and before "}" is ignored.
SEE ALSO
diff --git a/postfix/html/master.8.html b/postfix/html/master.8.html
index 64d6735d4..66087d344 100644
--- a/postfix/html/master.8.html
+++ b/postfix/html/master.8.html
@@ -47,23 +47,26 @@ MASTER(8) MASTER(8)
Terminate the master process after exit_time seconds. Child pro-
cesses terminate at their convenience.
- -i Enable init mode: do not attempt to become a session or process
- group leader; and to force termination, set an explicit signal
- handler instead of relying on the default signal action. This
- mode is allowed only if the process ID equals 1.
+ -i Enable init mode: do not become a session or process group
+ leader; similar to -s, do not redirect stdout to /dev/null, so
+ that "maillog_file = /dev/stdout" works. This mode is allowed
+ only if the process ID equals 1.
- -t Test mode. Return a zero exit status when the master.pid lock
- file does not exist or when that file is not locked. This is
+ -s Do not redirect stdout to /dev/null, so that "maillog_file =
+ /dev/stdout" works.
+
+ -t Test mode. Return a zero exit status when the master.pid lock
+ file does not exist or when that file is not locked. This is
evidence that the master(8) daemon is not running.
- -v Enable verbose logging for debugging purposes. This option is
+ -v Enable verbose logging for debugging purposes. This option is
passed on to child processes. Multiple -v options make the soft-
ware increasingly verbose.
-w Wait in a dummy foreground process, while the real master daemon
- initializes in a background process. The dummy foreground
- process returns a zero exit status only if the master daemon
- initialization is successful, and if it completes in a reason-
+ initializes in a background process. The dummy foreground
+ process returns a zero exit status only if the master daemon
+ initialization is successful, and if it completes in a reason-
able amount of time.
This feature is available in Postfix 2.10 and later.
@@ -71,27 +74,27 @@ MASTER(8) MASTER(8)
Signals:
SIGHUP Upon receipt of a HUP signal (e.g., after "postfix reload"), the
- master process re-reads its configuration files. If a service
- has been removed from the master.cf file, its running processes
- are terminated immediately. Otherwise, running processes are
- allowed to terminate as soon as is convenient, so that changes
+ master process re-reads its configuration files. If a service
+ has been removed from the master.cf file, its running processes
+ are terminated immediately. Otherwise, running processes are
+ allowed to terminate as soon as is convenient, so that changes
in configuration settings affect only new service requests.
SIGTERM
Upon receipt of a TERM signal (e.g., after "postfix abort"), the
- master process passes the signal on to its child processes and
- terminates. This is useful for an emergency shutdown. Normally
- one would terminate only the master ("postfix stop") and allow
+ master process passes the signal on to its child processes and
+ terminates. This is useful for an emergency shutdown. Normally
+ one would terminate only the master ("postfix stop") and allow
running processes to finish what they are doing.
DIAGNOSTICS
- Problems are reported to syslogd(8). The exit status is non-zero in
- case of problems, including problems while initializing as a master
+ Problems are reported to syslogd(8). The exit status is non-zero in
+ case of problems, including problems while initializing as a master
daemon process in the background.
ENVIRONMENT
MAIL_DEBUG
- After initialization, start a debugger as specified with the
+ After initialization, start a debugger as specified with the
debugger_command configuration parameter in the main.cf configu-
ration file.
@@ -99,18 +102,18 @@ MASTER(8) MASTER(8)
Directory with Postfix configuration files.
CONFIGURATION PARAMETERS
- Unlike most Postfix daemon processes, the master(8) server does not
- automatically pick up changes to main.cf. Changes to master.cf are
- never picked up automatically. Use the "postfix reload" command after
+ Unlike most Postfix daemon processes, the master(8) server does not
+ automatically pick up changes to main.cf. Changes to master.cf are
+ never picked up automatically. Use the "postfix reload" command after
a configuration change.
RESOURCE AND RATE CONTROLS
default_process_limit (100)
- The default maximal number of Postfix child processes that pro-
+ The default maximal number of Postfix child processes that pro-
vide a given service.
max_idle (100s)
- The maximum amount of time that an idle Postfix daemon process
+ The maximum amount of time that an idle Postfix daemon process
waits for an incoming connection before terminating voluntarily.
max_use (100)
@@ -118,18 +121,18 @@ MASTER(8) MASTER(8)
process will service before terminating voluntarily.
service_throttle_time (60s)
- How long the Postfix master(8) waits before forking a server
+ How long the Postfix master(8) waits before forking a server
that appears to be malfunctioning.
Available in Postfix version 2.6 and later:
master_service_disable (empty)
- Selectively disable master(8) listener ports by service type or
+ Selectively disable master(8) listener ports by service type or
by service name and type.
MISCELLANEOUS CONTROLS
config_directory (see 'postconf -d' output)
- The default location of the Postfix main.cf and master.cf con-
+ The default location of the Postfix main.cf and master.cf con-
figuration files.
daemon_directory (see 'postconf -d' output)
@@ -140,20 +143,20 @@ MASTER(8) MASTER(8)
invoked with the -D option.
inet_interfaces (all)
- The network interface addresses that this mail system receives
+ The network interface addresses that this mail system receives
mail on.
inet_protocols (all)
- The Internet protocols Postfix will attempt to use when making
+ The Internet protocols Postfix will attempt to use when making
or accepting connections.
import_environment (see 'postconf -d' output)
- The list of environment parameters that a privileged Postfix
- process will import from a non-Postfix parent process, or
+ The list of environment parameters that a privileged Postfix
+ process will import from a non-Postfix parent process, or
name=value environment overrides.
mail_owner (postfix)
- The UNIX system account that owns the Postfix queue and most
+ The UNIX system account that owns the Postfix queue and most
Postfix daemon processes.
process_id (read-only)
@@ -169,7 +172,7 @@ MASTER(8) MASTER(8)
The syslog facility of Postfix logging.
syslog_name (see 'postconf -d' output)
- A prefix that is prepended to the process name in syslog
+ A prefix that is prepended to the process name in syslog
records, so that, for example, "smtpd" becomes "prefix/smtpd".
Available in Postfix 3.3 and later:
@@ -178,7 +181,7 @@ MASTER(8) MASTER(8)
The master.cf service name of a Postfix daemon process.
FILES
- To expand the directory names below into their actual values, use the
+ To expand the directory names below into their actual values, use the
command "postconf config_directory" etc.
$config_directory/main.cf, global configuration file.
diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html
index 17e67f0a7..6aa08434c 100644
--- a/postfix/html/postconf.5.html
+++ b/postfix/html/postconf.5.html
@@ -6235,6 +6235,23 @@ substitutions in regular expression maps.
This feature is available in Postfix 2.3 and later.
+
+
+maillog_file
+(default: empty)
+
+ The name of an optional logfile that is written by the Postfix
+postlogd(8) service. A non-empty value disables logging to syslogd(8).
+Specify "/dev/stdout" for logging to standard output. Stdout logging
+requires that Postfix is started with "postfix start-fg".
+
+ Note: Some Postfix non-daemon programs may still log information
+to syslogd(8), before they have processed their configuration
+parameters and command-line options.
+
+ This feature is available in Postfix 3.4 and later.
+
+
mailq_path
@@ -7619,6 +7636,36 @@ is rejected by the reject_
This feature is available in Postfix 2.3 and later.
+
+
+postlog_service_name
+(default: postlog)
+
+ The name of the postlogd(8) service entry in master.cf.
+This service appends logfile records to the file specified
+with the maillog_file parameter.
+
+ This feature is available in Postfix 3.4 and later.
+
+
+
+
+postlogd_watchdog_timeout
+(default: 10s)
+
+ How much time a postlogd(8) process may take to process a request
+before it is terminated by a built-in watchdog timer. This is a
+safety mechanism that prevents postlogd(8) from becoming non-responsive
+due to a bug in Postfix itself or in system software. This limit
+cannot be set under 10s.
+
+ Specify a non-zero time value (an integral value plus an optional
+one-letter suffix that specifies the time unit). Time units: s
+(seconds), m (minutes), h (hours), d (days), w (weeks).
+
+ This feature is available in Postfix 3.4 and later.
+
+
postmulti_control_commands
@@ -19439,7 +19486,7 @@ cannot be set under 10s.
one-letter suffix that specifies the time unit). Time units: s
(seconds), m (minutes), h (hours), d (days), w (weeks).
- This feature is available in Postfix 2.8.
+ This feature is available in Postfix 2.8 and later
diff --git a/postfix/html/postdrop.1.html b/postfix/html/postdrop.1.html
index 994432632..9d73c335b 100644
--- a/postfix/html/postdrop.1.html
+++ b/postfix/html/postdrop.1.html
@@ -60,16 +60,18 @@ POSTDROP(1) POSTDROP(1)
alternate_config_directories (empty)
A list of non-default Postfix configuration directories that may
- be specified with "-c config_directory" on the command line, or
- via the MAIL_CONFIG environment parameter.
+ be specified with "-c config_directory" on the command line (in
+ the case of sendmail(1), with the "-C" option), or via the
+ MAIL_CONFIG environment parameter.
config_directory (see 'postconf -d' output)
- The default location of the Postfix main.cf and master.cf con-
+ The default location of the Postfix main.cf and master.cf con-
figuration files.
import_environment (see 'postconf -d' output)
- The list of environment parameters that a Postfix process will
- import from a non-Postfix parent process.
+ The list of environment parameters that a privileged Postfix
+ process will import from a non-Postfix parent process, or
+ name=value environment overrides.
queue_directory (see 'postconf -d' output)
The location of the Postfix top-level queue directory.
diff --git a/postfix/html/postfix-manuals.html b/postfix/html/postfix-manuals.html
index 18448053c..9b90c23df 100644
--- a/postfix/html/postfix-manuals.html
+++ b/postfix/html/postfix-manuals.html
@@ -208,6 +208,8 @@ the following convention:
pipe(8), deliver mail to non-Postfix command
+ postlogd(8), Postfix internal logging service
+
postscreen(8), Postfix zombie blocker
proxymap(8), Postfix lookup table proxy server
diff --git a/postfix/html/postfix.1.html b/postfix/html/postfix.1.html
index c7514f377..aeec1c36c 100644
--- a/postfix/html/postfix.1.html
+++ b/postfix/html/postfix.1.html
@@ -141,12 +141,23 @@ POSTFIX(1) POSTFIX(1)
MAIL_DEBUG
This is set when the -D command-line option is present.
+ When the internal logging service is enabled (by setting a non-empty
+ maillog_file parameter value) the postfix(1) command exports settings
+ that are used by child processes before they have processed main.cf or
+ command-line settings.
+
+ POSTLOG_SERVICE
+ The name of the public postlog service endpoint.
+
+ POSTLOG_HOSTNAME
+ The hostname to prepend to internal logging.
+
CONFIGURATION PARAMETERS
The following main.cf configuration parameters are exported as environ-
ment variables with the same names:
config_directory (see 'postconf -d' output)
- The default location of the Postfix main.cf and master.cf con-
+ The default location of the Postfix main.cf and master.cf con-
figuration files.
command_directory (see 'postconf -d' output)
@@ -156,22 +167,22 @@ POSTFIX(1) POSTFIX(1)
The directory with Postfix support programs and daemon programs.
html_directory (see 'postconf -d' output)
- The location of Postfix HTML files that describe how to build,
+ The location of Postfix HTML files that describe how to build,
configure or operate a specific Postfix subsystem or feature.
mail_owner (postfix)
- The UNIX system account that owns the Postfix queue and most
+ The UNIX system account that owns the Postfix queue and most
Postfix daemon processes.
mailq_path (see 'postconf -d' output)
- Sendmail compatibility feature that specifies where the Postfix
+ Sendmail compatibility feature that specifies where the Postfix
mailq(1) command is installed.
manpage_directory (see 'postconf -d' output)
Where the Postfix manual pages are installed.
newaliases_path (see 'postconf -d' output)
- Sendmail compatibility feature that specifies the location of
+ Sendmail compatibility feature that specifies the location of
the newaliases(1) command.
queue_directory (see 'postconf -d' output)
@@ -182,31 +193,31 @@ POSTFIX(1) POSTFIX(1)
configure or operate a specific Postfix subsystem or feature.
sendmail_path (see 'postconf -d' output)
- A Sendmail compatibility feature that specifies the location of
+ A Sendmail compatibility feature that specifies the location of
the Postfix sendmail(1) command.
setgid_group (postdrop)
- The group ownership of set-gid Postfix commands and of
+ The group ownership of set-gid Postfix commands and of
group-writable Postfix directories.
Available in Postfix version 2.5 and later:
data_directory (see 'postconf -d' output)
- The directory with Postfix-writable data files (for example:
+ The directory with Postfix-writable data files (for example:
caches, pseudo-random numbers).
Available in Postfix version 3.0 and later:
meta_directory (see 'postconf -d' output)
- The location of non-executable files that are shared among mul-
- tiple Postfix instances, such as postfix-files, dynamicmaps.cf,
- and the multi-instance template files main.cf.proto and mas-
+ The location of non-executable files that are shared among mul-
+ tiple Postfix instances, such as postfix-files, dynamicmaps.cf,
+ and the multi-instance template files main.cf.proto and mas-
ter.cf.proto.
shlib_directory (see 'postconf -d' output)
- The location of Postfix dynamically-linked libraries (libpost-
- fix-*.so), and the default location of Postfix database plugins
- (postfix-*.so) that have a relative pathname in the dynam-
+ The location of Postfix dynamically-linked libraries (libpost-
+ fix-*.so), and the default location of Postfix database plugins
+ (postfix-*.so) that have a relative pathname in the dynam-
icmaps.cf file.
Available in Postfix version 3.1 and later:
@@ -217,29 +228,29 @@ POSTFIX(1) POSTFIX(1)
Other configuration parameters:
import_environment (see 'postconf -d' output)
- The list of environment parameters that a privileged Postfix
- process will import from a non-Postfix parent process, or
+ The list of environment parameters that a privileged Postfix
+ process will import from a non-Postfix parent process, or
name=value environment overrides.
syslog_facility (mail)
The syslog facility of Postfix logging.
syslog_name (see 'postconf -d' output)
- A prefix that is prepended to the process name in syslog
+ A prefix that is prepended to the process name in syslog
records, so that, for example, "smtpd" becomes "prefix/smtpd".
Available in Postfix version 2.6 and later:
multi_instance_directories (empty)
- An optional list of non-default Postfix configuration directo-
- ries; these directories belong to additional Postfix instances
- that share the Postfix executable files and documentation with
- the default Postfix instance, and that are started, stopped,
+ An optional list of non-default Postfix configuration directo-
+ ries; these directories belong to additional Postfix instances
+ that share the Postfix executable files and documentation with
+ the default Postfix instance, and that are started, stopped,
etc., together with the default Postfix instance.
multi_instance_wrapper (empty)
- The pathname of a multi-instance manager command that the post-
- fix(1) command invokes when the multi_instance_directories
+ The pathname of a multi-instance manager command that the post-
+ fix(1) command invokes when the multi_instance_directories
parameter value is non-empty.
multi_instance_group (empty)
@@ -249,9 +260,18 @@ POSTFIX(1) POSTFIX(1)
The optional instance name of this Postfix instance.
multi_instance_enable (no)
- Allow this Postfix instance to be started, stopped, etc., by a
+ Allow this Postfix instance to be started, stopped, etc., by a
multi-instance manager.
+ Available in Postfix version 3.4 and later:
+
+ maillog_file (empty)
+ The name of an optional logfile that is written by the Postfix
+ postlogd(8) service.
+
+ postlog_service_name (postlog)
+ The name of the postlogd(8) service entry in master.cf.
+
FILES
Prior to Postfix version 2.6, all of the following files were in $con-
fig_directory. Some files are now in $daemon_directory so that they can
@@ -328,6 +348,7 @@ POSTFIX(1) POSTFIX(1)
oqmgr(8), old Postfix queue manager
pickup(8), Postfix local mail pickup
pipe(8), deliver mail to non-Postfix command
+ postlogd(8), Postfix internal logging service
postscreen(8), Postfix zombie blocker
proxymap(8), Postfix lookup table proxy server
qmgr(8), Postfix queue manager
diff --git a/postfix/html/postlog.1.html b/postfix/html/postlog.1.html
index bf3b0ad5a..672de9f58 100644
--- a/postfix/html/postlog.1.html
+++ b/postfix/html/postlog.1.html
@@ -20,8 +20,8 @@ POSTLOG(1) POSTLOG(1)
record. If no text is specified on the command line, postlog(1) reads
from standard input and logs each input line as one record.
- Logging is sent to syslogd(8); when the standard error stream is con-
- nected to a terminal, logging is sent there as well.
+ By default, logging is sent to syslogd(8); when the standard error
+ stream is connected to a terminal, logging is sent there as well.
The following options are implemented:
@@ -29,19 +29,21 @@ POSTLOG(1) POSTLOG(1)
Read the main.cf configuration file in the named directory
instead of the default configuration directory.
- -i Include the process ID in the logging tag.
+ -i (obsolete)
+ Include the process ID in the logging tag. This flag is ignored
+ as of Postfix 3.4, where the PID is always included.
-p priority (default: info)
- Specifies the logging severity: info, warn, error, fatal, or
- panic. With Postfix 3.1 and later, the program will pause for 1
- second after reporting a fatal or panic condition, just like
+ Specifies the logging severity: info, warn, error, fatal, or
+ panic. With Postfix 3.1 and later, the program will pause for 1
+ second after reporting a fatal or panic condition, just like
other Postfix programs.
- -t tag Specifies the logging tag, that is, the identifying name that
- appears at the beginning of each logging record. A default tag
+ -t tag Specifies the logging tag, that is, the identifying name that
+ appears at the beginning of each logging record. A default tag
is used when none is specified.
- -v Enable verbose logging for debugging purposes. Multiple -v
+ -v Enable verbose logging for debugging purposes. Multiple -v
options make the software increasingly verbose.
ENVIRONMENT
@@ -49,31 +51,41 @@ POSTLOG(1) POSTLOG(1)
Directory with the main.cf file.
CONFIGURATION PARAMETERS
- The following main.cf parameters are especially relevant to this pro-
+ The following main.cf parameters are especially relevant to this pro-
gram.
- The text below provides only a parameter summary. See postconf(5) for
+ The text below provides only a parameter summary. See postconf(5) for
more details including examples.
config_directory (see 'postconf -d' output)
- The default location of the Postfix main.cf and master.cf con-
+ The default location of the Postfix main.cf and master.cf con-
figuration files.
import_environment (see 'postconf -d' output)
- The list of environment parameters that a privileged Postfix
- process will import from a non-Postfix parent process, or
+ The list of environment parameters that a privileged Postfix
+ process will import from a non-Postfix parent process, or
name=value environment overrides.
syslog_facility (mail)
The syslog facility of Postfix logging.
syslog_name (see 'postconf -d' output)
- A prefix that is prepended to the process name in syslog
+ A prefix that is prepended to the process name in syslog
records, so that, for example, "smtpd" becomes "prefix/smtpd".
+ Available in Postfix 3.4 and later:
+
+ maillog_file (empty)
+ The name of an optional logfile that is written by the Postfix
+ postlogd(8) service.
+
+ postlog_service_name (postlog)
+ The name of the postlogd(8) service entry in master.cf.
+
SEE ALSO
postconf(5), configuration parameters
syslogd(8), syslog daemon
+ postlogd(8), internal logging service
LICENSE
The Secure Mailer license must be distributed with this software.
diff --git a/postfix/html/postlogd.8.html b/postfix/html/postlogd.8.html
new file mode 100644
index 000000000..d41c55488
--- /dev/null
+++ b/postfix/html/postlogd.8.html
@@ -0,0 +1,87 @@
+
+
+
+ Postfix manual - postlogd(8)
+
+POSTLOGD(8) POSTLOGD(8)
+
+NAME
+ postlogd - Postfix internal log server
+
+SYNOPSIS
+ postlogd [generic Postfix daemon options]
+
+DESCRIPTION
+ This program logs events on behalf of Postfix programs when the maillog
+ configuration parameter specifies a non-empty value.
+
+BUGS
+ Non-daemon Postfix programs don't know that they should log to the
+ internal logging service before they have processed command-line
+ options and main.cf parameters. These programs still log earlier events
+ to the syslog service.
+
+ If Postfix is down, the non-daemon programs postfix(1), postsuper(1),
+ postmulti(1), and postlog(1), will log directly to $maillog_file. These
+ programs expect to run with root privileges, for example during Postfix
+ start-up, reload, or shutdown.
+
+ Other non-daemon Postfix programs will never write directly to $mail-
+ log_file (also, logging to stdout would interfere with the operation of
+ some of these programs). These programs can log to postlogd(8) if they
+ are run by the super-user, or if their executable file has set-gid per-
+ mission. Do not set this permision on programs other than postdrop(1)
+ and postqueue(1).
+
+CONFIGURATION PARAMETERS
+ Changes to main.cf are picked up automatically, as postlogd(8) pro-
+ cesses run for only a limited amount of time. Use the command "postfix
+ reload" to speed up a change.
+
+ The text below provides only a parameter summary. See postconf(5) for
+ more details including examples.
+
+ config_directory (see 'postconf -d' output)
+ The default location of the Postfix main.cf and master.cf con-
+ figuration files.
+
+ maillog_file (empty)
+ The name of an optional logfile that is written by the Postfix
+ postlogd(8) service.
+
+ process_id (read-only)
+ The process ID of a Postfix command or daemon process.
+
+ process_name (read-only)
+ The process name of a Postfix command or daemon process.
+
+ syslog_name (see 'postconf -d' output)
+ A prefix that is prepended to the process name in syslog
+ records, so that, for example, "smtpd" becomes "prefix/smtpd".
+
+ service_name (read-only)
+ The master.cf service name of a Postfix daemon process.
+
+ postlogd_watchdog_timeout (10s)
+ How much time a postlogd(8) process may take to process a
+ request before it is terminated by a built-in watchdog timer.
+
+SEE ALSO
+ postconf(5), configuration parameters
+ syslogd(5), system logging
+
+LICENSE
+ The Secure Mailer license must be distributed with this software.
+
+HISTORY
+ This service was introduced with Postfix version 3.4.
+
+AUTHOR(S)
+ Wietse Venema
+ Google, Inc.
+ 111 8th Avenue
+ New York, NY 10011, USA
+
+ POSTLOGD(8)
+
diff --git a/postfix/html/postmulti.1.html b/postfix/html/postmulti.1.html
index c7c1f1570..0115b9fd8 100644
--- a/postfix/html/postmulti.1.html
+++ b/postfix/html/postmulti.1.html
@@ -399,5 +399,10 @@ POSTMULTI(1) POSTMULTI(1)
P.O. Box 704
Yorktown Heights, NY 10598, USA
+ Wietse Venema
+ Google, Inc.
+ 111 8th Avenue
+ New York, NY 10011, USA
+
POSTMULTI(1)