diff --git a/postfix/HISTORY b/postfix/HISTORY index bb6fa3631..899b65e3d 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -23198,9 +23198,16 @@ Apologies for any names omitted. 20171218 - Workaround: reportedly, FreeBSD 11.1 res_query(3) can return - -1 while h_errno==0. The DNS client now logs a warning and - sets h_errno to TRY_AGAIN. File: dns/dns_lookup.c. + Workaround: reportedly, some res_query(3) implementation + can return -1 with h_errno==0. Instead of terminating with + a panic, the DNS client now logs a warning and sets h_errno + to TRY_AGAIN. File: dns/dns_lookup.c. Cleanup: allow XCLIENT before STARTTLS, when TLS is required. File: smtpd/smtpd.c. + +20171219 + + Feature: preliminary support to run Postfix in the foreground. + This requires that multi-instance support is disabled. + Files: conf/postfix-script, postfix/postfix.c. diff --git a/postfix/conf/postfix-script b/postfix/conf/postfix-script index 6eb3c3589..629948c75 100755 --- a/postfix/conf/postfix-script +++ b/postfix/conf/postfix-script @@ -117,7 +117,7 @@ stop_msg) echo "Stop postfix" ;; -start) +start|start-fg) $daemon_directory/master -t 2>/dev/null || { $FATAL the Postfix mail system is already running @@ -135,11 +135,28 @@ start) $daemon_directory/postfix-script check-warn fi $INFO starting the Postfix mail system - # NOTE: wait in foreground process to get the initialization status. - $daemon_directory/master -w || { - $FATAL "mail system startup failed" - exit 1 - } + case $1 in + start) + # NOTE: wait in foreground process to get the initialization status. + $daemon_directory/master -w || { + $FATAL "mail system startup failed" + exit 1 + } + ;; + start-fg) + # Foreground start-up is incompatible with multi-instance mode. + # We can't use "exec $daemon_directory/master" here: that would + # break process group management, and "postfix stop" would kill + # too many processes. + case $instances in + "") $daemon_directory/master + ;; + *) $FATAL "start-fg does not support multi_instance_directories" + exit 1 + ;; + esac + ;; + esac ;; drain) diff --git a/postfix/html/postfix.1.html b/postfix/html/postfix.1.html index 954cde61e..218ffeb46 100644 --- a/postfix/html/postfix.1.html +++ b/postfix/html/postfix.1.html @@ -36,92 +36,97 @@ POSTFIX(1) POSTFIX(1) start Start the Postfix mail system. This also runs the configuration check described above. + start-fg + Like start, but keep the master daemon running in the fore- + ground. This requires that multi-instance support is disabled + (i.e. the multi_instance_directories parameter value is empty). + stop Stop the Postfix mail system in an orderly fashion. If possible, - running processes are allowed to terminate at their earliest + running processes are allowed to terminate at their earliest convenience. - Note: in order to refresh the Postfix mail system after a con- - figuration change, do not use the start and stop commands in + Note: in order to refresh the Postfix mail system after a con- + figuration change, do not use the start and stop commands in succession. Use the reload command instead. - abort Stop the Postfix mail system abruptly. Running processes are + abort Stop the Postfix mail system abruptly. Running processes are signaled to stop immediately. flush Force delivery: attempt to deliver every message in the deferred mail queue. Normally, attempts to deliver delayed mail happen at - regular intervals, the interval doubling after each failed + regular intervals, the interval doubling after each failed attempt. - Warning: flushing undeliverable mail frequently will result in + Warning: flushing undeliverable mail frequently will result in poor delivery performance of all other mail. - reload Re-read configuration files. Running processes terminate at + reload Re-read configuration files. Running processes terminate at their earliest convenience. status Indicate if the Postfix mail system is currently running. set-permissions [name=value ...] - Set the ownership and permissions of Postfix related files and + Set the ownership and permissions of Postfix related files and directories, as specified in the postfix-files file. - Specify name=value to override and update specific main.cf con- - figuration parameters. Use this, for example, to change the - mail_owner or setgid_group setting for an already installed + Specify name=value to override and update specific main.cf con- + figuration parameters. Use this, for example, to change the + mail_owner or setgid_group setting for an already installed Postfix system. - This feature is available in Postfix 2.1 and later. With Post- - fix 2.0 and earlier, use "$config_directory/post-install + This feature is available in Postfix 2.1 and later. With Post- + fix 2.0 and earlier, use "$config_directory/post-install set-permissions". tls subcommand - Enable opportunistic TLS in the Postfix SMTP client or server, - and manage Postfix SMTP server TLS private keys and certifi- + Enable opportunistic TLS in the Postfix SMTP client or server, + and manage Postfix SMTP server TLS private keys and certifi- cates. See postfix-tls(1) for documentation. This feature is available in Postfix 3.1 and later. upgrade-configuration [name=value ...] - Update the main.cf and master.cf files with information that - Postfix needs in order to run: add or update services, and add + Update the main.cf and master.cf files with information that + Postfix needs in order to run: add or update services, and add or update configuration parameter settings. - Specify name=value to override and update specific main.cf con- + Specify name=value to override and update specific main.cf con- figuration parameters. - This feature is available in Postfix 2.1 and later. With Post- - fix 2.0 and earlier, use "$config_directory/post-install + This feature is available in Postfix 2.1 and later. With Post- + fix 2.0 and earlier, use "$config_directory/post-install upgrade-configuration". The following options are implemented: -c config_dir - Read the main.cf and master.cf configuration files in the named - directory instead of the default configuration directory. Use - this to distinguish between multiple Postfix instances on the + Read the main.cf and master.cf configuration files in the named + directory instead of the default configuration directory. Use + this to distinguish between multiple Postfix instances on the same host. - With Postfix 2.6 and later, this option forces the postfix(1) + With Postfix 2.6 and later, this option forces the postfix(1) command to operate on the specified Postfix instance only. This - behavior is inherited by postfix(1) commands that run as a + behavior is inherited by postfix(1) commands that run as a descendant of the current process. -D (with postfix start only) Run each Postfix daemon under control of a debugger as specified via the debugger_command configuration parameter. - -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 - The postfix(1) command exports the following environment variables + The postfix(1) command exports the following environment variables before executing the postfix-script file: MAIL_CONFIG This is set when the -c command-line option is present. With Postfix 2.6 and later, this environment variable forces the - postfix(1) command to operate on the specified Postfix instance - only. This behavior is inherited by postfix(1) commands that + postfix(1) command to operate on the specified Postfix instance + only. This behavior is inherited by postfix(1) commands that run as a descendant of the current process. MAIL_VERBOSE @@ -135,7 +140,7 @@ POSTFIX(1) POSTFIX(1) 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) @@ -145,22 +150,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) @@ -171,31 +176,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: @@ -206,8 +211,9 @@ POSTFIX(1) POSTFIX(1) Other configuration parameters: 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. syslog_facility (mail) The syslog facility of Postfix logging. diff --git a/postfix/man/man1/postfix.1 b/postfix/man/man1/postfix.1 index b1efad608..4fdd71301 100644 --- a/postfix/man/man1/postfix.1 +++ b/postfix/man/man1/postfix.1 @@ -37,6 +37,11 @@ and create missing directories. .IP \fBstart\fR Start the Postfix mail system. This also runs the configuration check described above. +.IP \fBstart\-fg\fR +Like \fBstart\fR, but keep the master daemon running in the +foreground. This requires that multi\-instance support is +disabled (i.e. the multi_instance_directories parameter +value is empty). .IP \fBstop\fR Stop the Postfix mail system in an orderly fashion. If possible, running processes are allowed to terminate at @@ -187,8 +192,9 @@ The location of the OpenSSL command line program \fBopenssl\fR(1). .PP Other configuration parameters: .IP "\fBimport_environment (see 'postconf -d' output)\fR" -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. .IP "\fBsyslog_facility (mail)\fR" The syslog facility of Postfix logging. .IP "\fBsyslog_name (see 'postconf -d' output)\fR" diff --git a/postfix/src/dns/dns_lookup.c b/postfix/src/dns/dns_lookup.c index 8617eaa77..1ea98b387 100644 --- a/postfix/src/dns/dns_lookup.c +++ b/postfix/src/dns/dns_lookup.c @@ -397,14 +397,14 @@ static int dns_res_search(const char *name, int class, int type, /* Prepare for returning a null-padded server reply. */ memset(answer, 0, anslen); len = res_query(name, class, type, answer, anslen); - /* Begin FreeBSD 11.1 workaround. */ + /* Begin API creep workaround. */ if (len < 0 && h_errno == 0) { SET_H_ERRNO(TRY_AGAIN); msg_warn("res_query(\"%s\", %d, %d, %p, %d) returns %d with h_errno==0" " -- setting h_errno=TRY_AGAIN", name, class, type, answer, anslen, len); } - /* End FreeBSD 11.1 workaround. */ + /* End API creep workaround. */ if (len > 0) { SET_H_ERRNO(0); } else if (keep_notfound && NOT_FOUND_H_ERRNO(h_errno)) { diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index a30b51f7c..f31496010 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change both the patchlevel and the release date. Snapshots have no * patchlevel; they change the release date only. */ -#define MAIL_RELEASE_DATE "20171218" +#define MAIL_RELEASE_DATE "20171221" #define MAIL_VERSION_NUMBER "3.3" #ifdef SNAPSHOT diff --git a/postfix/src/postfix/postfix.c b/postfix/src/postfix/postfix.c index 0a9b368c4..474201527 100644 --- a/postfix/src/postfix/postfix.c +++ b/postfix/src/postfix/postfix.c @@ -31,6 +31,11 @@ /* .IP \fBstart\fR /* Start the Postfix mail system. This also runs the configuration /* check described above. +/* .IP \fBstart-fg\fR +/* Like \fBstart\fR, but keep the master daemon running in the +/* foreground. This requires that multi-instance support is +/* disabled (i.e. the multi_instance_directories parameter +/* value is empty). /* .IP \fBstop\fR /* Stop the Postfix mail system in an orderly fashion. If /* possible, running processes are allowed to terminate at @@ -177,8 +182,9 @@ /* .PP /* Other configuration parameters: /* .IP "\fBimport_environment (see 'postconf -d' output)\fR" -/* 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. /* .IP "\fBsyslog_facility (mail)\fR" /* The syslog facility of Postfix logging. /* .IP "\fBsyslog_name (see 'postconf -d' output)\fR"