From: Wietse Venema
The TLS security levels listed below are described in more detail -in the sections that follow.
+Similar to the Postfix SMTP server, the Postfix SMTP/LMTP client +implements multiple TLS security levels. These levels are described +in more detail in the sections that follow.
At the "none" TLS security level, TLS encryption is @@ -1821,7 +1810,7 @@ use the new policy table instead.
Postfix 2.3 introduces a new more flexible TLS policy table. For +
The current TLS policy table was introduced with Postfix 2.3. For earlier releases, read the description of the obsolete Postfix 2.2 per-site table.
diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index cb4bb3a89..ed16ac842 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -5510,7 +5510,7 @@ one-letter suffix that specifies the time unit).The macros that are sent to Milter (mail filter) applications after completion of an SMTP connection. See MILTER_README @@ -5556,7 +5556,7 @@ one-letter suffix that specifies the time unit).
The macros that are sent to version 4 or higher Milter (mail filter) applications after the SMTP DATA command. See MILTER_README @@ -5595,7 +5595,7 @@ the "hold" queue. Available with Pos
The macros that are sent to Milter (mail filter) applications after the message end-of-data. See MILTER_README for a list of @@ -5607,7 +5607,7 @@ available macro names and their meanings.
The macros that are sent to Milter (mail filter) applications after the end of the message header. See MILTER_README for a list @@ -5619,7 +5619,7 @@ of available macro names and their meanings.
The macros that are sent to Milter (mail filter) applications after the SMTP HELO or EHLO command. See @@ -5656,7 +5656,7 @@ meanings.
The macros that are sent to Milter (mail filter) applications after the SMTP MAIL FROM command. See MILTER_README @@ -5707,7 +5707,7 @@ will not reply for each individual message header.
The macros that are sent to Milter (mail filter) applications after the SMTP RCPT TO command. See MILTER_README @@ -5719,7 +5719,7 @@ for a list of available macro names and their meanings.
The macros that are sent to version 3 or higher Milter (mail filter) applications after an unknown SMTP command. See MILTER_README @@ -5798,6 +5798,87 @@ The default time unit is s (seconds).
+An optional list of non-default Postfix configuration directories; +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. Specify a list of pathnames +separated by comma or whitespace.
+ +This feature is available in Postfix 2.6 and later.
+ +When the list of non-default Postfix configuration directories +is non-empty, the postfix(1) command will invoke the multi-instance +manager specified with the multi_instance_wrapper parameter to +execute commands on the default instance and on all additional +Postfix instances.
+ +This feature is available in Postfix 2.6 and later.
+ + +Allow this Postfix instance to be started, stopped, etc., by a +multi-instance manager. By default, new instances are created in +a safe state that prevents them from being started inadvertently. +This parameter is reserved for the multi-instance manager.
+ +This feature is available in Postfix 2.6 and later.
+ + +The optional instance group name of this Postfix instance. A +group identifies closely-related Postfix instances that the +multi-instance manager can start, stop, etc., as a unit. This +parameter is reserved for the multi-instance manager.
+ +This feature is available in Postfix 2.6 and later.
+ + +The optional instance name of this Postfix instance. This name +becomes also the default value for the syslog_name parameter.
+ +This feature is available in Postfix 2.6 and later.
+ + +The pathname of a multi-instance manager command that the +postfix(1) command invokes when the multi_instance_directories +parameter value is non-empty. The pathname may be followed by +initial command arguments separated by whitespace; shell +metacharacters are not supported in this context.
+ +The postfix(1) command invokes the manager command with the +postfix(1) non-option command arguments on the manager command line, +and with all installation configuration parameters exported into +the manager command process environment. The manager command in +turn invokes the postfix(1) command for individual Postfix instances +as "postfix -c config_directory command".
+ +This feature is available in Postfix 2.6 and later.
+ +The mail system name that is prepended to the process name in syslog diff --git a/postfix/html/postfix-manuals.html b/postfix/html/postfix-manuals.html index 9a6ea668e..b1c5efcf7 100644 --- a/postfix/html/postfix-manuals.html +++ b/postfix/html/postfix-manuals.html @@ -94,6 +94,8 @@ the following convention:
+POSTFIX-WRAPPER(5) POSTFIX-WRAPPER(5) + +NAME + postfix-wrapper - Postfix multi-instance API + +DESCRIPTION + This document describes an interface that allows a multi- + instance manager to plug into Postfix and to control mul- + tiple Postfix instances. + + Each Postfix instance is defined by its own configuration + directory with its own main.cf and master.cf files, by its + own queue and data directories, and by its own myhostname + and inet_interfaces settings. Other Postfix files, includ- + ing executable files and documentation, are shared between + Postfix instances. + + Only the default Postfix instance is required. The loca- + tion of its configuration files is specified by the built- + in default value for the config_directory parameter. + Other Postfix instances are optional. + +GENERAL OPERATION + First of all, nothing changes when there is only one Post- + fix instance. + + Even after multi-instance support has been set up through + the mechanisms discussed later, sites can still continue + to use the familiar "postfix start / stop / reload / + upgrade / etc" commands in boot scripts, build procedures, + etc. + + To start, stop, update, etc., multiple Postfix instances, + use: + + # postfix command + + For example, to find out what Postfix instances are con- + figured: + + # postfix status + + To manage an individual Postfix instance, use: + + # postfix -c /path/to/config_directory command + +MULTI-INSTANCE DETECTION + While "postfix start/stop/etc" will remain the primary + command interface, the postfix(1) command itself will need + to figure out if a command targets multiple Postfix + instances or just a specific Postfix instance. This deci- + sion can be made with information that is already avail- + able: + + When the postfix(1) command is invoked with the -c + option, it will operate only on the specified + instance. We do the same when MAIL_CONFIG is spec- + ified in the process environment. + + Otherwise, the postfix(1) command will operate on + all applicable Postfix instances. + +MULTI-INSTANCE MANAGER HOOK + When the postfix(1) command is invoked without -c option, + and non-default Postfix instance directories are defined + in main.cf with multi_instance_directories, then the post- + fix(1) command invokes the command specified in main.cf + with multi_instance_wrapper, instead of invoking postfix- + script. The multi_instance_wrapper and other main.cf + parameters are listed in the CONFIGURATION PARAMETERS sec- + tion below. + + A useful wrapper implementation can be as simple as: + + #!/bin/sh + + : ${command_directory?"do not invoke this command directly"} + + POSTCONF=$command_directory/postconf + POSTFIX=$command_directory/postfix + instance_dirs=`$POSTCONF -h multi_instance_directories | + sed 's/,/ /'` || exit 1 + + for dir in $config_directory $instance_dirs + do + case "$1" in + stop|abort|flush|reload|drain) + test "`$POSTCONF -c $dir -h multi_instance_enable`" + = yes || continue;; + start) + test "`$POSTCONF -c $dir -h multi_instance_enable`" + = yes || set check;; + esac + $POSTFIX -c $dir "$@" || err=$? + done + + exit $err + + This wrapper skips commands such as "stop" that require a + running Postfix instance when a Postfix instance is dis- + abled, and replaces "start" by "check" so that problems + will still be reported. + + The postmulti(1) command implements a more sophisticated + approach, based on a combination of C code and scripting. + +SHARED VERSUS NON-SHARED FILES + Some files are shared between Postfix instances (such as + executables and manpages) and some files are per-instance + (such as the queue). See the NON-SHARED FILES section + below for a list of per-instance files. + + Until now, executables, manpages, etc., have been checked + or updated as part of the default Postfix instance. With + multi-instance support, we simply continue to do this. + Non-default Postfix instances will check or update only + their non-shared files. + + The consequence of this approach is that the default Post- + fix instance should be updated before any other instances. + +IMPLEMENTATION NOTES + The postfix(1) command ignores the multi_instance_directo- + ries and multi_instance_wrapper parameters when the -c + option is specified, or when MAIL_CONFIG is present in the + process environment. + + Otherwise, the postfix(1) command uses the + multi_instance_wrapper parameter only when the + multi_instance_directories parameter value is non-empty. + + The multi-instance manager must replace a "start" command + by "check" when a Postfix instance does not have + "multi_instance_enable = yes". This substitution ensures + that problems will still be reported. + + Set-gid commands such as postdrop(1) and postqueue(1) + effectively append the multi_instance_directories parame- + ter value to the legacy alternate_config_directories + parameter value. + + The legacy alternate_config_directories parameter remains + necessary for non-default Postfix instances that are run- + ning different versions of Postfix, or that are not man- + aged together with the default Postfix instance. + + No Postfix command or script will update or check shared + files unless it is running in the context of the default + Postfix instance. + +ENVIRONMENT VARIABLES + MAIL_CONFIG + When present, this forces the postfix(1) command to + operate only on the specified Postfix instance. + This environment variable is exported by the post- + fix(1) -c option, so that postfix(1) commands in + descendant processes will work correctly. + +CONFIGURATION PARAMETERS + multi_instance_directories (empty) + An optional list of non-default Postfix configura- + tion directories; these directories belong to addi- + tional 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 postfix(1) command invokes when the + multi_instance_directories parameter value is non- + empty. + + multi_instance_name (empty) + The optional instance name of this Postfix + instance. + + multi_instance_group (empty) + The optional instance group name of this Postfix + instance. + + multi_instance_enable (no) + Allow this Postfix instance to be started, stopped, + etc., by a multi-instance manager. + +NON-SHARED FILES + config_directory (see 'postconf -d' output) + The default location of the Postfix main.cf and + master.cf configuration files. + + data_directory (see 'postconf -d' output) + The directory with Postfix-writable data files (for + example: caches, pseudo-random numbers). + + queue_directory (see 'postconf -d' output) + The location of the Postfix top-level queue direc- + tory. + +SEE ALSO + postfix(1) Postfix control program + postmulti(1) full-blown multi-instance manager + +LICENSE + The Secure Mailer license must be distributed with this + software. + +AUTHOR(S) + Wietse Venema + IBM T.J. Watson Research + P.O. Box 704 + Yorktown Heights, NY 10598, USA + + POSTFIX-WRAPPER(5) +diff --git a/postfix/html/postfix.1.html b/postfix/html/postfix.1.html index 14da6a7f3..ffc4a7b98 100644 --- a/postfix/html/postfix.1.html +++ b/postfix/html/postfix.1.html @@ -20,9 +20,15 @@ POSTFIX(1) POSTFIX(1) fix mail system: start or stop the master(8) daemon, do a health check, and other maintenance. - The postfix(1) command sets up a standardized environment - and runs the postfix-script shell script to do the actual - work. + By default, the postfix(1) command sets up a standardized + environment and runs the postfix-script shell script to do + the actual work. + + However, when support for multiple Postfix instances is + configured, postfix(1) executes the command specified with + the multi_instance_wrapper configuration parameter. This + command will execute the command for each applicable Post- + fix instance. The following commands are implemented: @@ -95,6 +101,12 @@ POSTFIX(1) POSTFIX(1) between multiple Postfix instances on the same host. + 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 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 @@ -112,6 +124,12 @@ POSTFIX(1) POSTFIX(1) This is set when the -c command-line option is present. + With Postfix 2.6 and later, this environment vari- + able 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 + descendant of the current process. + MAIL_VERBOSE This is set when the -v command-line option is present. @@ -179,14 +197,42 @@ POSTFIX(1) POSTFIX(1) The directory with Postfix-writable data files (for example: caches, pseudo-random numbers). + Available in Postfix version 2.6 and later: + + multi_instance_directories (empty) + An optional list of non-default Postfix configura- + tion directories; these directories belong to addi- + tional 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 postfix(1) command invokes when the + multi_instance_directories parameter value is non- + empty. + + multi_instance_group (empty) + The optional instance group name of this Postfix + instance. + + multi_instance_name (empty) + The optional instance name of this Postfix + instance. + + multi_instance_enable (no) + Allow this Postfix instance to be started, stopped, + etc., by a multi-instance manager. + Other configuration parameters: config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and + The default location of the Postfix main.cf and master.cf configuration files. import_environment (see 'postconf -d' output) - The list of environment parameters that a Postfix + The list of environment parameters that a Postfix process will import from a non-Postfix parent process. @@ -194,18 +240,18 @@ POSTFIX(1) POSTFIX(1) The syslog facility of Postfix logging. syslog_name (postfix) - The mail system name that is prepended to the - process name in syslog records, so that "smtpd" + The mail system name that is prepended to the + process name in syslog records, so that "smtpd" becomes, for example, "postfix/smtpd". FILES - Prior to Postfix version 2.6, all of the following files - were in $config_directory. Some files are now in $dae- - mon_directory so that they can be shared among multiple + Prior to Postfix version 2.6, all of the following files + were in $config_directory. Some files are now in $dae- + mon_directory so that they can be shared among multiple instances that run the same Postfix version. - Use the command "postconf config_directory" or "postconf - daemon_directory" to expand the names into their actual + Use the command "postconf config_directory" or "postconf + daemon_directory" to expand the names into their actual values. $config_directory/main.cf, Postfix configuration parameters @@ -224,6 +270,7 @@ POSTFIX(1) POSTFIX(1) postlock(1), Postfix-compatible locking postlog(1), Postfix-compatible logging postmap(1), Postfix lookup table manager + postmulti(1), Postfix multi-instance manager postqueue(1), Postfix mail queue control postsuper(1), Postfix housekeeping mailq(1), Sendmail compatibility interface @@ -234,6 +281,7 @@ POSTFIX(1) POSTFIX(1) bounce(5), Postfix bounce message templates master(5), Postfix master.cf file syntax postconf(5), Postfix main.cf file syntax + postfix-wrapper(5), Postfix multi-instance API Table-driven mechanisms: access(5), Postfix SMTP access control table @@ -292,7 +340,7 @@ POSTFIX(1) POSTFIX(1) QSHAPE_README, Postfix queue analysis LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) diff --git a/postfix/man/Makefile.in b/postfix/man/Makefile.in index 7ff2e3471..094ed3e2a 100644 --- a/postfix/man/Makefile.in +++ b/postfix/man/Makefile.in @@ -17,7 +17,7 @@ CONFIG = man5/access.5 man5/aliases.5 man5/canonical.5 man5/relocated.5 \ man5/cidr_table.5 man5/tcp_table.5 man5/header_checks.5 \ man5/body_checks.5 man5/ldap_table.5 man5/mysql_table.5 \ man5/pgsql_table.5 man5/master.5 man5/nisplus_table.5 \ - man5/generic.5 man5/bounce.5 + man5/generic.5 man5/bounce.5 man5/postfix-wrapper.5 TOOLS = man1/smtp-sink.1 man1/smtp-source.1 man1/qmqp-sink.1 \ man1/qmqp-source.1 man1/qshape.1 @@ -278,6 +278,11 @@ man5/transport.5: ../proto/transport man5/virtual.5: ../proto/virtual ../mantools/srctoman - $? >$@ +man5/postfix-wrapper.5: ../proto/postfix-wrapper + ../mantools/fixman ../proto/postconf.proto $? >junk && \ + (cmp -s junk $? || mv junk $?) && rm -f junk + ../mantools/srctoman - $? >$@ + man1/smtp-sink.1: ../src/smtpstone/smtp-sink.c ../mantools/fixman ../proto/postconf.proto $? >junk && \ (cmp -s junk $? || mv junk $?) && rm -f junk diff --git a/postfix/man/man1/postfix.1 b/postfix/man/man1/postfix.1 index 26b827856..1557775db 100644 --- a/postfix/man/man1/postfix.1 +++ b/postfix/man/man1/postfix.1 @@ -20,8 +20,15 @@ The \fBpostfix\fR(1) command controls the operation of the Postfix mail system: start or stop the \fBmaster\fR(8) daemon, do a health check, and other maintenance. -The \fBpostfix\fR(1) command sets up a standardized environment and -runs the \fBpostfix-script\fR shell script to do the actual work. +By default, the \fBpostfix\fR(1) command sets up a standardized +environment and runs the \fBpostfix-script\fR shell script +to do the actual work. + +However, when support for multiple Postfix instances is +configured, \fBpostfix\fR(1) executes the command specified +with the \fBmulti_instance_wrapper\fR configuration parameter. +This command will execute the \fIcommand\fR for each +applicable Postfix instance. The following commands are implemented: .IP \fBcheck\fR @@ -83,6 +90,11 @@ Read the \fBmain.cf\fR and \fBmaster.cf\fR 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) +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. .IP "\fB-D\fR (with \fBpostfix start\fR only)" Run each Postfix daemon under control of a debugger as specified via the \fBdebugger_command\fR configuration parameter. @@ -98,6 +110,11 @@ The \fBpostfix\fR(1) command exports the following environment variables before executing the \fBpostfix-script\fR file: .IP \fBMAIL_CONFIG\fR 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 run as a descendant of the current process. .IP \fBMAIL_VERBOSE\fR This is set when the -v command-line option is present. .IP \fBMAIL_DEBUG\fR @@ -147,6 +164,25 @@ Available in Postfix version 2.5 and later: The directory with Postfix-writable data files (for example: caches, pseudo-random numbers). .PP +Available in Postfix version 2.6 and later: +.IP "\fBmulti_instance_directories (empty)\fR" +An optional list of non-default Postfix configuration directories; +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. +.IP "\fBmulti_instance_wrapper (empty)\fR" +The pathname of a multi-instance manager command that the +\fBpostfix\fR(1) command invokes when the multi_instance_directories +parameter value is non-empty. +.IP "\fBmulti_instance_group (empty)\fR" +The optional instance group name of this Postfix instance. +.IP "\fBmulti_instance_name (empty)\fR" +The optional instance name of this Postfix instance. +.IP "\fBmulti_instance_enable (no)\fR" +Allow this Postfix instance to be started, stopped, etc., by +a multi-instance manager. +.PP Other configuration parameters: .IP "\fBconfig_directory (see 'postconf -d' output)\fR" The default location of the Postfix main.cf and master.cf @@ -192,6 +228,7 @@ postkick(1), trigger Postfix daemon postlock(1), Postfix-compatible locking postlog(1), Postfix-compatible logging postmap(1), Postfix lookup table manager +postmulti(1), Postfix multi-instance manager postqueue(1), Postfix mail queue control postsuper(1), Postfix housekeeping mailq(1), Sendmail compatibility interface @@ -202,6 +239,7 @@ Postfix configuration: bounce(5), Postfix bounce message templates master(5), Postfix master.cf file syntax postconf(5), Postfix main.cf file syntax +postfix-wrapper(5), Postfix multi-instance API Table-driven mechanisms: access(5), Postfix SMTP access control table diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index be8248a12..6a3bf7dec 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -3060,7 +3060,7 @@ Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds). .PP This feature is available in Postfix 2.3 and later. -.SH milter_connect_macros (default: see postconf -n output) +.SH milter_connect_macros (default: see "postconf -d" output) The macros that are sent to Milter (mail filter) applications after completion of an SMTP connection. See MILTER_README for a list of available macro names and their meanings. @@ -3088,7 +3088,7 @@ Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds). .PP This feature is available in Postfix 2.3 and later. -.SH milter_data_macros (default: see postconf -n output) +.SH milter_data_macros (default: see "postconf -d" output) The macros that are sent to version 4 or higher Milter (mail filter) applications after the SMTP DATA command. See MILTER_README for a list of available macro names and their meanings. @@ -3110,19 +3110,19 @@ Like "accept", but freeze the message in the "hold" queue. Available with Postfix 2.6 and later. .PP This feature is available in Postfix 2.3 and later. -.SH milter_end_of_data_macros (default: see postconf -n output) +.SH milter_end_of_data_macros (default: see "postconf -d" output) The macros that are sent to Milter (mail filter) applications after the message end-of-data. See MILTER_README for a list of available macro names and their meanings. .PP This feature is available in Postfix 2.3 and later. -.SH milter_end_of_header_macros (default: see postconf -n output) +.SH milter_end_of_header_macros (default: see "postconf -d" output) The macros that are sent to Milter (mail filter) applications after the end of the message header. See MILTER_README for a list of available macro names and their meanings. .PP This feature is available in Postfix 2.5 and later. -.SH milter_helo_macros (default: see postconf -n output) +.SH milter_helo_macros (default: see "postconf -d" output) The macros that are sent to Milter (mail filter) applications after the SMTP HELO or EHLO command. See MILTER_README for a list of available macro names and their meanings. @@ -3140,7 +3140,7 @@ See MILTER_README for a list of available macro names and their meanings. .PP This feature is available in Postfix 2.3 and later. -.SH milter_mail_macros (default: see postconf -n output) +.SH milter_mail_macros (default: see "postconf -d" output) The macros that are sent to Milter (mail filter) applications after the SMTP MAIL FROM command. See MILTER_README for a list of available macro names and their meanings. @@ -3171,13 +3171,13 @@ Specify this when the Milter application will not reply for each individual message header. .PP This feature is available in Postfix 2.3 and later. -.SH milter_rcpt_macros (default: see postconf -n output) +.SH milter_rcpt_macros (default: see "postconf -d" output) The macros that are sent to Milter (mail filter) applications after the SMTP RCPT TO command. See MILTER_README for a list of available macro names and their meanings. .PP This feature is available in Postfix 2.3 and later. -.SH milter_unknown_command_macros (default: see postconf -n output) +.SH milter_unknown_command_macros (default: see "postconf -d" output) The macros that are sent to version 3 or higher Milter (mail filter) applications after an unknown SMTP command. See MILTER_README for a list of available macro names and their meanings. @@ -3211,6 +3211,57 @@ $queue_run_delay. See also $maximal_backoff_time. .PP Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds). +.SH multi_instance_directories (default: empty) +An optional list of non-default Postfix configuration directories; +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. Specify a list of pathnames +separated by comma or whitespace. +.PP +This feature is available in Postfix 2.6 and later. +.PP +When the list of non-default Postfix configuration directories +is non-empty, the \fBpostfix\fR(1) command will invoke the multi-instance +manager specified with the multi_instance_wrapper parameter to +execute commands on the default instance and on all additional +Postfix instances. +.PP +This feature is available in Postfix 2.6 and later. +.SH multi_instance_enable (default: no) +Allow this Postfix instance to be started, stopped, etc., by a +multi-instance manager. By default, new instances are created in +a safe state that prevents them from being started inadvertently. +This parameter is reserved for the multi-instance manager. +.PP +This feature is available in Postfix 2.6 and later. +.SH multi_instance_group (default: empty) +The optional instance group name of this Postfix instance. A +group identifies closely-related Postfix instances that the +multi-instance manager can start, stop, etc., as a unit. This +parameter is reserved for the multi-instance manager. +.PP +This feature is available in Postfix 2.6 and later. +.SH multi_instance_name (default: empty) +The optional instance name of this Postfix instance. This name +becomes also the default value for the syslog_name parameter. +.PP +This feature is available in Postfix 2.6 and later. +.SH multi_instance_wrapper (default: empty) +The pathname of a multi-instance manager command that the +\fBpostfix\fR(1) command invokes when the multi_instance_directories +parameter value is non-empty. The pathname may be followed by +initial command arguments separated by whitespace; shell +metacharacters are not supported in this context. +.PP +The \fBpostfix\fR(1) command invokes the manager command with the +\fBpostfix\fR(1) non-option command arguments on the manager command line, +and with all installation configuration parameters exported into +the manager command process environment. The manager command in +turn invokes the \fBpostfix\fR(1) command for individual Postfix instances +as "postfix -c \fIconfig_directory\fR \fIcommand\fR". +.PP +This feature is available in Postfix 2.6 and later. .SH multi_recipient_bounce_reject_code (default: 550) The numerical Postfix SMTP server response code when a remote SMTP client request is blocked by the reject_multi_recipient_bounce @@ -8173,7 +8224,7 @@ after a Postfix process has completed initialization. Errors during process initialization will be logged with the default facility. Examples are errors while parsing the command line arguments, and errors while accessing the Postfix main.cf configuration file. -.SH syslog_name (default: postfix) +.SH syslog_name (default: see "postconf -d" output) The mail system name that is prepended to the process name in syslog records, so that "smtpd" becomes, for example, "postfix/smtpd". .PP diff --git a/postfix/man/man5/postfix-wrapper.5 b/postfix/man/man5/postfix-wrapper.5 new file mode 100644 index 000000000..739eb9998 --- /dev/null +++ b/postfix/man/man5/postfix-wrapper.5 @@ -0,0 +1,237 @@ +.TH POSTFIX-WRAPPER 5 +.ad +.fi +.SH NAME +postfix-wrapper +\- +Postfix multi-instance API +.SH DESCRIPTION +.ad +.fi +This document describes an interface that allows a +multi-instance manager to plug into Postfix and to control +multiple Postfix instances. + +Each Postfix instance is defined by its own configuration +directory with its own main.cf and master.cf files, by its +own queue and data directories, and by its own myhostname +and inet_interfaces settings. Other Postfix files, including +executable files and documentation, are shared between +Postfix instances. + +Only the default Postfix instance is required. The location +of its configuration files is specified by the built-in +default value for the config_directory parameter. Other +Postfix instances are optional. +.SH "GENERAL OPERATION" +.na +.nf +.ad +.fi +First of all, nothing changes when there is only one Postfix +instance. + +Even after multi-instance support has been set up through +the mechanisms discussed later, sites can still continue +to use the familiar "postfix start / stop / reload / upgrade +/ etc" commands in boot scripts, build procedures, etc. + +To start, stop, update, etc., multiple Postfix instances, +use: + +.nf + # postfix \fIcommand\fR +.fi + +For example, to find out what Postfix instances are configured: + +.nf + # postfix status + +To manage an individual Postfix instance, use: + +.nf + # postfix -c \fI/path/to/config_directory command\fR +.fi +.SH "MULTI-INSTANCE DETECTION" +.na +.nf +.ad +.fi +While "postfix start/stop/etc" will remain the primary +command interface, the postfix(1) command itself will need +to figure out if a command targets multiple Postfix instances +or just a specific Postfix instance. This decision can be +made with information that is already available: +.IP +When the postfix(1) command is invoked with the -c +option, it will operate only on the specified instance. +We do the same when MAIL_CONFIG is specified in the +process environment. + +Otherwise, the postfix(1) command will operate on all +applicable Postfix instances. +.SH "MULTI-INSTANCE MANAGER HOOK" +.na +.nf +.ad +.fi +When the postfix(1) command is invoked without -c option, +and non-default Postfix instance directories are defined +in main.cf with multi_instance_directories, then the +postfix(1) command invokes the command specified in main.cf +with multi_instance_wrapper, instead of invoking postfix-script. +The multi_instance_wrapper and other main.cf parameters are +listed in the CONFIGURATION PARAMETERS section below. + +A useful wrapper implementation can be as simple as: + +.nf +.ft C + #!/bin/sh + + : ${command_directory?"do not invoke this command directly"} + + POSTCONF=$command_directory/postconf + POSTFIX=$command_directory/postfix + instance_dirs=`$POSTCONF -h multi_instance_directories | + sed 's/,/ /'` || exit 1 + + for dir in $config_directory $instance_dirs + do + case "$1" in + stop|abort|flush|reload|drain) + test "`$POSTCONF -c $dir -h multi_instance_enable`" + = yes || continue;; + start) + test "`$POSTCONF -c $dir -h multi_instance_enable`" + = yes || set check;; + esac + $POSTFIX -c $dir "$@" || err=$? + done + + exit $err +.ft +.fi + +This wrapper skips commands such as "stop" that require a +running Postfix instance when a Postfix instance is disabled, +and replaces "start" by "check" so that problems will still +be reported. + +The postmulti(1) command implements a more sophisticated +approach, based on a combination of C code and scripting. +.SH "SHARED VERSUS NON-SHARED FILES" +.na +.nf +.ad +.fi +Some files are shared between Postfix instances (such as +executables and manpages) and some files are per-instance +(such as the queue). See the NON-SHARED FILES section below +for a list of per-instance files. + +Until now, executables, manpages, etc., have been checked +or updated as part of the default Postfix instance. With +multi-instance support, we simply continue to do this. +Non-default Postfix instances will check or update only +their non-shared files. + +The consequence of this approach is that the default Postfix +instance should be updated before any other instances. +.SH "IMPLEMENTATION NOTES" +.na +.nf +.ad +.fi +The postfix(1) command ignores the multi_instance_directories +and multi_instance_wrapper parameters when the -c option +is specified, or when MAIL_CONFIG is present in the process +environment. + +Otherwise, the postfix(1) command uses the multi_instance_wrapper +parameter only when the multi_instance_directories parameter +value is non-empty. + +The multi-instance manager must replace a "start" command by +"check" when a Postfix instance does not have +"multi_instance_enable = yes". This substitution ensures +that problems will still be reported. + +Set-gid commands such as postdrop(1) and postqueue(1) +effectively append the multi_instance_directories parameter +value to the legacy alternate_config_directories parameter +value. + +The legacy alternate_config_directories parameter remains +necessary for non-default Postfix instances that are running +different versions of Postfix, or that are not managed +together with the default Postfix instance. + +No Postfix command or script will update or check shared +files unless it is running in the context of the default +Postfix instance. +.SH "ENVIRONMENT VARIABLES" +.na +.nf +.ad +.fi +.IP MAIL_CONFIG +When present, this forces the postfix(1) command to operate +only on the specified Postfix instance. This environment +variable is exported by the postfix(1) -c option, so that +postfix(1) commands in descendant processes will work +correctly. +.SH "CONFIGURATION PARAMETERS" +.na +.nf +.ad +.fi +.IP "\fBmulti_instance_directories (empty)\fR" +An optional list of non-default Postfix configuration directories; +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. +.IP "\fBmulti_instance_wrapper (empty)\fR" +The pathname of a multi-instance manager command that the +\fBpostfix\fR(1) command invokes when the multi_instance_directories +parameter value is non-empty. +.IP "\fBmulti_instance_name (empty)\fR" +The optional instance name of this Postfix instance. +.IP "\fBmulti_instance_group (empty)\fR" +The optional instance group name of this Postfix instance. +.IP "\fBmulti_instance_enable (no)\fR" +Allow this Postfix instance to be started, stopped, etc., by a +multi-instance manager. +.SH "NON-SHARED FILES" +.na +.nf +.ad +.fi +.IP "\fBconfig_directory (see 'postconf -d' output)\fR" +The default location of the Postfix main.cf and master.cf +configuration files. +.IP "\fBdata_directory (see 'postconf -d' output)\fR" +The directory with Postfix-writable data files (for example: +caches, pseudo-random numbers). +.IP "\fBqueue_directory (see 'postconf -d' output)\fR" +The location of the Postfix top-level queue directory. +.SH "SEE ALSO" +.na +.nf +postfix(1) Postfix control program +postmulti(1) full-blown multi-instance manager +.SH "LICENSE" +.na +.nf +.ad +.fi +The Secure Mailer license must be distributed with this software. +.SH "AUTHOR(S)" +.na +.nf +Wietse Venema +IBM T.J. Watson Research +P.O. Box 704 +Yorktown Heights, NY 10598, USA diff --git a/postfix/mantools/fixman b/postfix/mantools/fixman index c3d443b61..635729e64 100755 --- a/postfix/mantools/fixman +++ b/postfix/mantools/fixman @@ -56,10 +56,11 @@ sub save_text # Emit one parameter name and text -sub emit_text() +sub emit_text { + my ($delim) = @_; if ($block = $param_text{$name}) { - print "/* .IP \"\\fB$name ($defval_text{$name})\\fR\"\n"; + print "$delim .IP \"\\fB$name ($defval_text{$name})\\fR\"\n"; $wantpp = 0; $block =~ s/]*>//g; $block =~ s/<\/a>//g; @@ -105,14 +106,14 @@ sub emit_text() $block =~ s/([_a-zA-Z0-9-]+)(\([0-9]\))/\\fB\1\\fR\2/g; # Encapsulate as C code comment. - $block =~ s/^([^.])/\/\*\t\1/; - $block =~ s/^\./\/\* ./; - $block =~ s/\n([^.])/\n\/\*\t\1/g; - $block =~ s/\n\./\n\/\* ./g; + $block =~ s/^([^.])/$delim\t\1/; + $block =~ s/^\./$delim ./; + $block =~ s/\n([^.])/\n$delim\t\1/g; + $block =~ s/\n\./\n$delim ./g; print $block; } else { - print "/* .IP \"\\fB$name ($defval)\\fR\"\n"; + print "$delim .IP \"\\fB$name ($defval)\\fR\"\n"; print $text; } $name = ""; @@ -168,19 +169,19 @@ if ($name && $text) { save_text(); } -# Process source file with embedded text. For now, hard-coded for C. +# Process source file with embedded text. For now, hard-coded for C & sh. while(<>) { - if (/^\/\*\+\+/) { + if (/^(\/\*|#)\+\+/) { $incomment = 1; $name = ""; print; next; } - if (/^\/\*--/) { - emit_text() if ($name ne ""); + if (/^(\/\*|#)--/) { + emit_text($1) if ($name ne ""); $incomment = 0; print; next; @@ -191,43 +192,43 @@ while(<>) { next; } - if (/\/\* +CONFIGURATION +PARAM/) { + if (/(\/\*|#) +CONFIGURATION +PARAM/) { $incomment = 2; } # Delete text after nested itemized list. - if ($incomment == 2 && /^\/\* +\.IP ""/) { + if ($incomment == 2 && /^(\/\*|#) +\.IP ""/) { $text .= $_; while (<>) { - last if /^\/\* +([A-Z][A-Z][A-Z]+|\.[A-Z][A-Z])/; + last if /^(\/\*|#) +([A-Z][A-Z][A-Z]+|\.[A-Z][A-Z])/; $text .= $_; } } # Delete nested itemized list. - if ($incomment == 2 && /^\/\* +\.RS/) { + if ($incomment == 2 && /^(\/\*|#) +\.RS/) { $text .= $_; $rsnest++; while (<>) { $text .= $_; - $rsnest++ if /^\/\* +\.RS/; - $rsnest-- if /\/\* +\.RE/; + $rsnest++ if /^(\/\*|#) +\.RS/; + $rsnest-- if /(\/\*|#) +\.RE/; last if $rsnest == 0; } next; } - if ($incomment == 2 && /^\/\* +\.IP +"?\\fB([a-zA-Z0-9_]+)( +\((.*)\))?/) { - emit_text() if ($name ne ""); - $name = $1; - $defval = $3; + if ($incomment == 2 && /^(\/\*|#) +\.IP +"?\\fB([a-zA-Z0-9_]+)( +\((.*)\))?/) { + emit_text($1) if ($name ne ""); + $name = $2; + $defval = $4; $text = ""; next; } - if ($incomment == 2 && /^\/\* +([A-Z][A-Z][A-Z]+|\.[A-Z][A-Z])/) { - emit_text() if ($name ne ""); - $incomment = 0 if /^\/\* +(SEE +ALSO|README +FILES|LICENSE|AUTHOR)/; + if ($incomment == 2 && /^(\/\*|#) +([A-Z][A-Z][A-Z]+|\.[A-Z][A-Z])/) { + emit_text($1) if ($name ne ""); + $incomment = 0 if /^(\/\*|#) +(SEE +ALSO|README +FILES|LICENSE|AUTHOR)/; print; next; } diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index 31aeb03f9..18d03198e 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -93,7 +93,7 @@ while (<>) { s;\ballow_min_user\b;$&;g; s;\ballow_percent_hack\b;$&;g; s;\ballow_untrusted_routing\b;$&;g; - s;\balternate_config_directories\b;$&;g; + s;\balternate_config_direc[-]*\n*[
The TLS security levels listed below are described in more detail -in the sections that follow.
+Similar to the Postfix SMTP server, the Postfix SMTP/LMTP client +implements multiple TLS security levels. These levels are described +in more detail in the sections that follow.
At the "none" TLS security level, TLS encryption is @@ -1821,7 +1810,7 @@ use the new policy table instead.
Postfix 2.3 introduces a new more flexible TLS policy table. For +
The current TLS policy table was introduced with Postfix 2.3. For earlier releases, read the description of the obsolete Postfix 2.2 per-site table.
diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 01d2c3837..71ff51181 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -6061,7 +6061,7 @@ Examples are errors while parsing the command line arguments, and errors while accessing the Postfix main.cf configuration file. -%PARAM syslog_name postfix +%PARAM syslog_name see "postconf -d" outputThe mail system name that is prepended to the process name in syslog @@ -10503,7 +10503,7 @@ one-letter suffix that specifies the time unit).
This feature is available in Postfix 2.3 and later.
-%PARAM milter_connect_macros see postconf -n output +%PARAM milter_connect_macros see "postconf -d" outputThe macros that are sent to Milter (mail filter) applications after completion of an SMTP connection. See MILTER_README @@ -10511,7 +10511,7 @@ for a list of available macro names and their meanings.
This feature is available in Postfix 2.3 and later.
-%PARAM milter_helo_macros see postconf -n output +%PARAM milter_helo_macros see "postconf -d" outputThe macros that are sent to Milter (mail filter) applications after the SMTP HELO or EHLO command. See @@ -10520,7 +10520,7 @@ MILTER_README for a list of available macro names and their meanings.
This feature is available in Postfix 2.3 and later.
-%PARAM milter_mail_macros see postconf -n output +%PARAM milter_mail_macros see "postconf -d" outputThe macros that are sent to Milter (mail filter) applications after the SMTP MAIL FROM command. See MILTER_README @@ -10528,7 +10528,7 @@ for a list of available macro names and their meanings.
This feature is available in Postfix 2.3 and later.
-%PARAM milter_rcpt_macros see postconf -n output +%PARAM milter_rcpt_macros see "postconf -d" outputThe macros that are sent to Milter (mail filter) applications after the SMTP RCPT TO command. See MILTER_README @@ -10536,7 +10536,7 @@ for a list of available macro names and their meanings.
This feature is available in Postfix 2.3 and later.
-%PARAM milter_data_macros see postconf -n output +%PARAM milter_data_macros see "postconf -d" outputThe macros that are sent to version 4 or higher Milter (mail filter) applications after the SMTP DATA command. See MILTER_README @@ -10544,7 +10544,7 @@ for a list of available macro names and their meanings.
This feature is available in Postfix 2.3 and later.
-%PARAM milter_end_of_header_macros see postconf -n output +%PARAM milter_end_of_header_macros see "postconf -d" outputThe macros that are sent to Milter (mail filter) applications after the end of the message header. See MILTER_README for a list @@ -10552,7 +10552,7 @@ of available macro names and their meanings.
This feature is available in Postfix 2.5 and later.
-%PARAM milter_end_of_data_macros see postconf -n output +%PARAM milter_end_of_data_macros see "postconf -d" outputThe macros that are sent to Milter (mail filter) applications after the message end-of-data. See MILTER_README for a list of @@ -10560,7 +10560,7 @@ available macro names and their meanings.
This feature is available in Postfix 2.3 and later.
-%PARAM milter_unknown_command_macros see postconf -n output +%PARAM milter_unknown_command_macros see "postconf -d" outputThe macros that are sent to version 3 or higher Milter (mail filter) applications after an unknown SMTP command. See MILTER_README @@ -12023,3 +12023,64 @@ tcp_windowsize change will work only for Postfix TCP clients (smtp(8), lmtp(8)).
This feature is available in Postfix 2.6 and later.
+ +%PARAM multi_instance_directories + +An optional list of non-default Postfix configuration directories; +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. Specify a list of pathnames +separated by comma or whitespace.
+ +This feature is available in Postfix 2.6 and later.
+ +When the list of non-default Postfix configuration directories +is non-empty, the postfix(1) command will invoke the multi-instance +manager specified with the multi_instance_wrapper parameter to +execute commands on the default instance and on all additional +Postfix instances.
+ +This feature is available in Postfix 2.6 and later.
+ +%PARAM multi_instance_wrapper + +The pathname of a multi-instance manager command that the +postfix(1) command invokes when the multi_instance_directories +parameter value is non-empty. The pathname may be followed by +initial command arguments separated by whitespace; shell +metacharacters are not supported in this context.
+ +The postfix(1) command invokes the manager command with the +postfix(1) non-option command arguments on the manager command line, +and with all installation configuration parameters exported into +the manager command process environment. The manager command in +turn invokes the postfix(1) command for individual Postfix instances +as "postfix -c config_directory command".
+ +This feature is available in Postfix 2.6 and later.
+ +%PARAM multi_instance_group + +The optional instance group name of this Postfix instance. A +group identifies closely-related Postfix instances that the +multi-instance manager can start, stop, etc., as a unit. This +parameter is reserved for the multi-instance manager.
+ +This feature is available in Postfix 2.6 and later.
+ +%PARAM multi_instance_name + +The optional instance name of this Postfix instance. This name +becomes also the default value for the syslog_name parameter.
+ +This feature is available in Postfix 2.6 and later.
+ +%PARAM multi_instance_enable no + +Allow this Postfix instance to be started, stopped, etc., by a +multi-instance manager. By default, new instances are created in +a safe state that prevents them from being started inadvertently. +This parameter is reserved for the multi-instance manager.
+ +This feature is available in Postfix 2.6 and later.
diff --git a/postfix/proto/postfix-wrapper b/postfix/proto/postfix-wrapper new file mode 100644 index 000000000..5bce8cd93 --- /dev/null +++ b/postfix/proto/postfix-wrapper @@ -0,0 +1,212 @@ +#++ +# NAME +# postfix-wrapper 5 +# SUMMARY +# Postfix multi-instance API +# DESCRIPTION +# This document describes an interface that allows a +# multi-instance manager to plug into Postfix and to control +# multiple Postfix instances. +# +# Each Postfix instance is defined by its own configuration +# directory with its own main.cf and master.cf files, by its +# own queue and data directories, and by its own myhostname +# and inet_interfaces settings. Other Postfix files, including +# executable files and documentation, are shared between +# Postfix instances. +# +# Only the default Postfix instance is required. The location +# of its configuration files is specified by the built-in +# default value for the config_directory parameter. Other +# Postfix instances are optional. +# GENERAL OPERATION +# .ad +# .fi +# First of all, nothing changes when there is only one Postfix +# instance. +# +# Even after multi-instance support has been set up through +# the mechanisms discussed later, sites can still continue +# to use the familiar "postfix start / stop / reload / upgrade +# / etc" commands in boot scripts, build procedures, etc. +# +# To start, stop, update, etc., multiple Postfix instances, +# use: +# +# .nf +# # postfix \fIcommand\fR +# .fi +# +# For example, to find out what Postfix instances are configured: +# +# .nf +# # postfix status +# +# To manage an individual Postfix instance, use: +# +# .nf +# # postfix -c \fI/path/to/config_directory command\fR +# .fi +# MULTI-INSTANCE DETECTION +# .ad +# .fi +# While "postfix start/stop/etc" will remain the primary +# command interface, the postfix(1) command itself will need +# to figure out if a command targets multiple Postfix instances +# or just a specific Postfix instance. This decision can be +# made with information that is already available: +# .IP +# When the postfix(1) command is invoked with the -c +# option, it will operate only on the specified instance. +# We do the same when MAIL_CONFIG is specified in the +# process environment. +# +# Otherwise, the postfix(1) command will operate on all +# applicable Postfix instances. +# MULTI-INSTANCE MANAGER HOOK +# .ad +# .fi +# When the postfix(1) command is invoked without -c option, +# and non-default Postfix instance directories are defined +# in main.cf with multi_instance_directories, then the +# postfix(1) command invokes the command specified in main.cf +# with multi_instance_wrapper, instead of invoking postfix-script. +# The multi_instance_wrapper and other main.cf parameters are +# listed in the CONFIGURATION PARAMETERS section below. +# +# A useful wrapper implementation can be as simple as: +# +# .nf +# .ft C +# #!/bin/sh +# +# : ${command_directory?"do not invoke this command directly"} +# +# POSTCONF=$command_directory/postconf +# POSTFIX=$command_directory/postfix +# instance_dirs=`$POSTCONF -h multi_instance_directories | +# sed 's/,/ /'` || exit 1 +# +# for dir in $config_directory $instance_dirs +# do +# case "$1" in +# stop|abort|flush|reload|drain) +# test "`$POSTCONF -c $dir -h multi_instance_enable`" +# = yes || continue;; +# start) +# test "`$POSTCONF -c $dir -h multi_instance_enable`" +# = yes || set check;; +# esac +# $POSTFIX -c $dir "$@" || err=$? +# done +# +# exit $err +# .ft +# .fi +# +# This wrapper skips commands such as "stop" that require a +# running Postfix instance when a Postfix instance is disabled, +# and replaces "start" by "check" so that problems will still +# be reported. +# +# The postmulti(1) command implements a more sophisticated +# approach, based on a combination of C code and scripting. +# SHARED VERSUS NON-SHARED FILES +# .ad +# .fi +# Some files are shared between Postfix instances (such as +# executables and manpages) and some files are per-instance +# (such as the queue). See the NON-SHARED FILES section below +# for a list of per-instance files. +# +# Until now, executables, manpages, etc., have been checked +# or updated as part of the default Postfix instance. With +# multi-instance support, we simply continue to do this. +# Non-default Postfix instances will check or update only +# their non-shared files. +# +# The consequence of this approach is that the default Postfix +# instance should be updated before any other instances. +# IMPLEMENTATION NOTES +# .ad +# .fi +# The postfix(1) command ignores the multi_instance_directories +# and multi_instance_wrapper parameters when the -c option +# is specified, or when MAIL_CONFIG is present in the process +# environment. +# +# Otherwise, the postfix(1) command uses the multi_instance_wrapper +# parameter only when the multi_instance_directories parameter +# value is non-empty. +# +# The multi-instance manager must replace a "start" command by +# "check" when a Postfix instance does not have +# "multi_instance_enable = yes". This substitution ensures +# that problems will still be reported. +# +# Set-gid commands such as postdrop(1) and postqueue(1) +# effectively append the multi_instance_directories parameter +# value to the legacy alternate_config_directories parameter +# value. +# +# The legacy alternate_config_directories parameter remains +# necessary for non-default Postfix instances that are running +# different versions of Postfix, or that are not managed +# together with the default Postfix instance. +# +# No Postfix command or script will update or check shared +# files unless it is running in the context of the default +# Postfix instance. +# ENVIRONMENT VARIABLES +# .ad +# .fi +# .IP MAIL_CONFIG +# When present, this forces the postfix(1) command to operate +# only on the specified Postfix instance. This environment +# variable is exported by the postfix(1) -c option, so that +# postfix(1) commands in descendant processes will work +# correctly. +# CONFIGURATION PARAMETERS +# .ad +# .fi +# .IP "\fBmulti_instance_directories (empty)\fR" +# An optional list of non-default Postfix configuration directories; +# 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. +# .IP "\fBmulti_instance_wrapper (empty)\fR" +# The pathname of a multi-instance manager command that the +# \fBpostfix\fR(1) command invokes when the multi_instance_directories +# parameter value is non-empty. +# .IP "\fBmulti_instance_name (empty)\fR" +# The optional instance name of this Postfix instance. +# .IP "\fBmulti_instance_group (empty)\fR" +# The optional instance group name of this Postfix instance. +# .IP "\fBmulti_instance_enable (no)\fR" +# Allow this Postfix instance to be started, stopped, etc., by a +# multi-instance manager. +# NON-SHARED FILES +# .ad +# .fi +# .IP "\fBconfig_directory (see 'postconf -d' output)\fR" +# The default location of the Postfix main.cf and master.cf +# configuration files. +# .IP "\fBdata_directory (see 'postconf -d' output)\fR" +# The directory with Postfix-writable data files (for example: +# caches, pseudo-random numbers). +# .IP "\fBqueue_directory (see 'postconf -d' output)\fR" +# The location of the Postfix top-level queue directory. +# SEE ALSO +# postfix(1) Postfix control program +# postmulti(1) full-blown multi-instance manager +# LICENSE +# .ad +# .fi +# The Secure Mailer license must be distributed with this software. +# AUTHOR(S) +# Wietse Venema +# IBM T.J. Watson Research +# P.O. Box 704 +# Yorktown Heights, NY 10598, USA +#-- diff --git a/postfix/src/bounce/bounce_notify_verp.c b/postfix/src/bounce/bounce_notify_verp.c index 715611d37..749b347c8 100644 --- a/postfix/src/bounce/bounce_notify_verp.c +++ b/postfix/src/bounce/bounce_notify_verp.c @@ -158,8 +158,7 @@ int bounce_notify_verp(int flags, char *service, char *queue_name, && (rcpt->dsn_notify & DSN_NOTIFY_FAILURE) == 0) { bounce_status = 0; } else { - verp_sender(verp_buf, verp_delims, recipient, rcpt->orig_addr[0] ? - rcpt->orig_addr : rcpt->address); + verp_sender(verp_buf, verp_delims, recipient, rcpt); if ((bounce = post_mail_fopen_nowait(NULL_SENDER, STR(verp_buf), INT_FILT_BOUNCE, NULL_TRACE_FLAGS, diff --git a/postfix/src/global/mail_conf.c b/postfix/src/global/mail_conf.c index c323ab6af..c5d3d4321 100644 --- a/postfix/src/global/mail_conf.c +++ b/postfix/src/global/mail_conf.c @@ -123,7 +123,8 @@ static void mail_conf_checkdir(const char *config_dir) buf = vstring_alloc(1); while (found == 0 && readlline(buf, fp, (int *) 0)) { if (split_nameval(vstring_str(buf), &name, &value) == 0 - && strcmp(name, VAR_CONFIG_DIRS) == 0) { + && (strcmp(name, VAR_CONFIG_DIRS) == 0 + || strcmp(name, VAR_MULTI_CONF_DIRS) == 0)) { while (found == 0 && (cp = mystrtok(&value, ", \t\r\n")) != 0) if (strcmp(cp, config_dir) == 0) found = 1; diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index cd3aa3d41..d53931c6e 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -112,6 +112,12 @@ /* char *var_int_filt_classes; /* int var_cyrus_sasl_authzid; /* +/* char *var_multi_conf_dirs; +/* char *var_multi_wrapper; +/* char *var_multi_group; +/* char *var_multi_name; +/* bool var_multi_enable; +/* /* void mail_params_init() /* /* const char null_format_string[1]; @@ -291,6 +297,12 @@ int var_delay_max_res; char *var_int_filt_classes; int var_cyrus_sasl_authzid; +char *var_multi_conf_dirs; +char *var_multi_wrapper; +char *var_multi_group; +char *var_multi_name; +bool var_multi_enable; + const char null_format_string[1] = ""; /* check_myhostname - lookup hostname and validate */ @@ -497,6 +509,10 @@ void mail_params_init() static const CONFIG_STR_TABLE first_str_defaults[] = { VAR_SYSLOG_FACILITY, DEF_SYSLOG_FACILITY, &var_syslog_facility, 1, 0, VAR_INET_PROTOCOLS, DEF_INET_PROTOCOLS, &var_inet_protocols, 1, 0, + VAR_MULTI_CONF_DIRS, DEF_MULTI_CONF_DIRS, &var_multi_conf_dirs, 0, 0, + VAR_MULTI_WRAPPER, DEF_MULTI_WRAPPER, &var_multi_wrapper, 0, 0, + VAR_MULTI_GROUP, DEF_MULTI_GROUP, &var_multi_group, 0, 0, + VAR_MULTI_NAME, DEF_MULTI_NAME, &var_multi_name, 0, 0, 0, }; static const CONFIG_STR_FN_TABLE function_str_defaults[] = { @@ -605,6 +621,7 @@ void mail_params_init() VAR_OLDLOG_COMPAT, DEF_OLDLOG_COMPAT, &var_oldlog_compat, VAR_HELPFUL_WARNINGS, DEF_HELPFUL_WARNINGS, &var_helpful_warnings, VAR_CYRUS_SASL_AUTHZID, DEF_CYRUS_SASL_AUTHZID, &var_cyrus_sasl_authzid, + VAR_MULTI_ENABLE, DEF_MULTI_ENABLE, &var_multi_enable, 0, }; const char *cp; diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index b976ed474..b0ab32afd 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -2267,7 +2267,12 @@ extern char *var_virt_mailbox_lock; * Distinct logging tag for multiple Postfix instances. */ #define VAR_SYSLOG_NAME "syslog_name" +#if 1 +#define DEF_SYSLOG_NAME \ + "${" VAR_MULTI_NAME ":postfix}${" VAR_MULTI_NAME "?$" VAR_MULTI_NAME "}" +#else #define DEF_SYSLOG_NAME "postfix" +#endif extern char *var_syslog_name; /* @@ -3041,6 +3046,30 @@ extern bool var_strict_mbox_owner; #define DEF_INET_WINDOW 0 extern int var_inet_windowsize; + /* + * Plug-in multi-instance support. Only the first two paramaters are used by + * Postfix itself; the other ones are reserved for the instance manager. + */ +#define VAR_MULTI_CONF_DIRS "multi_instance_directories" +#define DEF_MULTI_CONF_DIRS "" +extern char *var_multi_conf_dirs; + +#define VAR_MULTI_WRAPPER "multi_instance_wrapper" +#define DEF_MULTI_WRAPPER "" +extern char *var_multi_wrapper; + +#define VAR_MULTI_NAME "multi_instance_name" +#define DEF_MULTI_NAME "" +extern char *var_multi_name; + +#define VAR_MULTI_GROUP "multi_instance_group" +#define DEF_MULTI_GROUP "" +extern char *var_multi_group; + +#define VAR_MULTI_ENABLE "multi_instance_enable" +#define DEF_MULTI_ENABLE 0 +extern bool var_multi_enable; + /* LICENSE /* .ad /* .fi diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index b01abb072..7e956d316 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 "20090114" +#define MAIL_RELEASE_DATE "20090122" #define MAIL_VERSION_NUMBER "2.6" #ifdef SNAPSHOT diff --git a/postfix/src/global/verp_sender.c b/postfix/src/global/verp_sender.c index 922c1ce1f..1d1149f6c 100644 --- a/postfix/src/global/verp_sender.c +++ b/postfix/src/global/verp_sender.c @@ -10,7 +10,7 @@ /* VSTRING *dst; /* const char *delims; /* const char *sender; -/* const char *recipient; +/* const RECIPIENT *recipient; /* /* const char *verp_delims_verify(delims) /* const char *delims; @@ -59,22 +59,29 @@ /* Global library. */ #include