diff --git a/postfix/HISTORY b/postfix/HISTORY
index 0e687f07a..87355d1e6 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -11702,6 +11702,31 @@ Apologies for any names omitted.
smtp_dot_quit_workaround_threshold_time parameter. Files:
smtp/smtp_proto.c, smtp/smtp.c.
+ Feature: mailbox_transport_maps and fallback_transport_maps
+ to search delivery transports by recipient name. Files:
+ local/mailbox.c, local/unknown.c.
+
+ Feature: the master daemon now logs a warning when all
+ servers are busy that may accept remote connections, and
+ suggests to either increase the process count or to reduce
+ the service time per client. Files: master/master_ent.c,
+ master/master_avail.c.
+
+20051231
+
+ Bugfix: the anvil server would terminate after "max_idle"
+ seconds, even when this was less than the anvil_rate_time_unit
+ interval. File: anvil/anvil.c.
+
+20060102
+
+ Deleted the 20051229 dot-quit bug workaround. Automatically
+ deferring delivery created "no delivery" and "repeated
+ delivery" problems; and automatically turning off pipelining
+ for delayed mail was a bad workaround for a bad workaround.
+ The administrator still has the option to turn off pipelining
+ by hand if loss of mail is a concern.
+
Open problems:
"postsuper -r" no longer resets the message arrival time,
diff --git a/postfix/README_FILES/FILTER_README b/postfix/README_FILES/FILTER_README
index 7b0245bb5..c6246bc8e 100644
--- a/postfix/README_FILES/FILTER_README
+++ b/postfix/README_FILES/FILTER_README
@@ -100,7 +100,7 @@ The content filter can be a simple shell script like this:
5
6 # Localize these. The -G option does nothing before Postfix 2.3.
7 INSPECT_DIR=/var/spool/filter
- 8 SENDMAIL="/usr/sbin/sendmail -G -i"
+ 8 SENDMAIL="/usr/sbin/sendmail -G -i" # NEVER NEVER NEVER use "-t" here.
9
10 # Exit codes from
Line 8: The -i option says don't stop reading input when a line contains "." only.
+Line 8: NEVER NEVER NEVER use the "-t" command-line option +here. It will mis-deliver mail, like sending mailing list mail back +to the mailing list.
+Line 21: The idea is to first capture the message to file and then run the content through a third-party content filter program.
@@ -348,7 +352,7 @@ is supposed to store its temporary files. with the pipe(8) delivery agent.-/etc/postfix/master.cf: +/etc/postfix/master.cf: # ============================================================= # service type private unpriv chroot wakeup maxproc command # (yes) (yes) (yes) (never) (100) @@ -364,11 +368,11 @@ up a lot of system resources, so you don't want to have too much of it running at the same time.
To turn on content filtering for mail arriving via SMTP -only, append "-o content_filter=filter:dummy" to the master.cf +only, append "-o content_filter=filter:dummy" to the master.cf entry that defines the Postfix SMTP server:
-/etc/postfix/master.cf: +/etc/postfix/master.cf: # ============================================================= # service type private unpriv chroot wakeup maxproc command # (yes) (yes) (yes) (never) (100) @@ -423,7 +427,7 @@ for filtered mail.To turn off "simple" content filtering:
-
Edit the master.cf file, remove the "-o +
Edit the master.cf file, remove the "-o content_filter=filter:dummy" text from the entry that defines the Postfix SMTP server.
@@ -562,11 +566,11 @@ performance loss.To enable the advanced content filter method for all mail, -specify in main.cf:
+specify in main.cf:-/etc/postfix/main.cf: +/etc/postfix/main.cf: content_filter = scan:localhost:10025 receive_override_options = no_address_mappings@@ -599,12 +603,12 @@ filterIn this example, "scan" is an instance of the Postfix SMTP client with slightly different configuration parameters. This is -how one would set up the service in the Postfix master.cf file: +how one would set up the service in the Postfix master.cf file:
-/etc/postfix/master.cf: +/etc/postfix/master.cf: # ============================================================= # service type private unpriv chroot wakeup maxproc command # (yes) (yes) (yes) (never) (100) @@ -623,7 +627,8 @@ gobble up a lot of system resources, so you don't want to have too much of it running at the same time.With "-o smtp_send_xforward_command=yes", the scan transport -will try to forward the original client name and IP address to the +will try to forward the original client name and IP address +through the content filter to the after-filter smtpd process, so that filtered mail is logged with the real client name IP address. See smtp(8) and XFORWARD_README for more information.
@@ -638,7 +643,7 @@ up to 10 content filtering processes on localhost port 10025:-/etc/postfix/master.cf: +/etc/postfix/master.cf: # =================================================================== # service type private unpriv chroot wakeup maxproc command # (yes) (yes) (yes) (never) (100) @@ -676,7 +681,7 @@ that injects mail back into Postfix.-/etc/postfix/master.cf: +/etc/postfix/master.cf: # =================================================================== # service type private unpriv chroot wakeup maxproc command # (yes) (yes) (yes) (never) (100) @@ -698,16 +703,16 @@ that injects mail back into Postfix.Note: do not use spaces around the "=" or "," characters.
Note: the SMTP server must not have a smaller process -limit than the "filter" master.cf entry.
+limit than the "filter" master.cf entry. -The "-o content_filter=" overrides main.cf settings, and +
The "-o content_filter=" overrides main.cf settings, and requests no content filtering for mail from the content filter. This is required or else mail will stay in the content filtering loop.
-The "-o receive_override_options" overrides main.cf +
The "-o receive_override_options" overrides main.cf settings. It is complementary to the options that are specified in -main.cf:
+main.cf:@@ -726,7 +731,7 @@ main.cf:
The "-o smtpd_xxx_restrictions" and "-o mynetworks=127.0.0.0/8" -override main.cf settings. They turn off junk mail controls that +override main.cf settings. They turn off junk mail controls that would only waste time here.
With "-o smtpd_authorized_xforward_hosts=127.0.0.0/8", @@ -757,13 +762,13 @@ Postfix instances will be covered in a future version.
To turn off "advanced" content filtering:
-
Delete or comment out the two following main.cf lines. +
Delete or comment out the two following main.cf lines. The other changes made for advanced content filtering have no effect when content filtering is turned off.
-/etc/postfix/main.cf: +/etc/postfix/main.cf: content_filter = scan:localhost:10025 receive_override_options = no_address_mappings@@ -779,7 +784,7 @@ filter information from existing queue files.Filtering mail from outside users only
The easiest approach is to configure ONE Postfix instance with -multiple SMTP server IP addresses in master.cf:
+multiple SMTP server IP addresses in master.cf:@@ -787,7 +792,7 @@ multiple SMTP server IP addresses in master.cf: with content filtering turned off.
-/etc/postfix.master.cf: +/etc/postfix.master.cf: # ================================================================== # service type private unpriv chroot wakeup maxproc command # (yes) (yes) (yes) (never) (100) @@ -802,7 +807,7 @@ with content filtering turned off. content filtering turned on.-/etc/postfix.master.cf: +/etc/postfix.master.cf: # ================================================================= # service type private unpriv chroot wakeup maxproc command # (yes) (yes) (yes) (never) (100) @@ -817,19 +822,19 @@ content filtering turned on.After this, you can follow the same procedure as outlined in the "advanced" or "simple" content filtering examples above, except that you must not specify "content_filter" or "receive_override_options" -in the main.cf file.
+in the main.cf file.Different filters for different domains
If you are an MX service provider and want to apply different content filters for different domains, you can configure ONE Postfix -instance with multiple SMTP server IP addresses in master.cf. Each +instance with multiple SMTP server IP addresses in master.cf. Each address provides a different content filter service.
-/etc/postfix.master.cf: +/etc/postfix.master.cf: # ================================================================= # service type private unpriv chroot wakeup maxproc command # (yes) (yes) (yes) (never) (100) @@ -849,7 +854,7 @@ address provides a different content filter service.After this, you can follow the same procedure as outlined in the "advanced" or "simple" content filtering examples above, except that you must not specify "content_filter" or "receive_override_options" -in the main.cf file.
+in the main.cf file.Set up MX records in the DNS that route each domain to the proper SMTP server instance.
@@ -892,7 +897,7 @@ loop.
FILTER actions from smtpd access maps and header/body_checks -take precedence over filters specified with the main.cf content_filter +take precedence over filters specified with the main.cf content_filter parameter.
If a message triggers more than one filter action, only diff --git a/postfix/html/anvil.8.html b/postfix/html/anvil.8.html index 2852582ff..b8f45190c 100644 --- a/postfix/html/anvil.8.html +++ b/postfix/html/anvil.8.html @@ -151,7 +151,7 @@ ANVIL(8) ANVIL(8) explicitly limit them. CONFIGURATION PARAMETERS - On low-traffic mail systems, changes to main.cf are picked + On low-traffic mail systems, changes to main.cf are picked up automatically as anvil(8) processes run for only a lim- ited amount of time. On other mail systems, use the com- mand "postfix reload" to speed up a change. @@ -168,8 +168,8 @@ ANVIL(8) ANVIL(8) limiting server logs peak usage information. config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and - master.cf configuration files. + The default location of the Postfix main.cf and + master.cf configuration files. daemon_timeout (18000s) How much time a Postfix daemon process may take to diff --git a/postfix/html/local.8.html b/postfix/html/local.8.html index 35a836dbe..3fca90874 100644 --- a/postfix/html/local.8.html +++ b/postfix/html/local.8.html @@ -105,20 +105,22 @@ LOCAL(8) LOCAL(8) maildir delivery. Mailbox delivery can be delegated to an external command - specified with the mailbox_command configuration parame- - ter. The command executes with the privileges of the - recipient user (exceptions: secondary groups are not - enabled; in case of delivery as root, the command executes - with the privileges of default_privs). + specified with the mailbox_command_maps and mailbox_com- + mand configuration parameters. The command executes with + the privileges of the recipient user (exceptions: sec- + ondary groups are not enabled; in case of delivery as + root, the command executes with the privileges of + default_privs). - Mailbox delivery can be delegated to alternative message - transports specified in the master.cf file. The mail- - box_transport configuration parameter specifies a message - transport that is to be used for all local recipients, - regardless of whether they are found in the UNIX passwd - database. The fallback_transport parameter specifies a - message transport for recipients that are not found in the - UNIX passwd database. + Mailbox delivery can be delegated to alternative message + transports specified in the master.cf file. The mail- + box_transport_maps and mailbox_transport configuration + parameters specify an optional message transport that is + to be used for all local recipients, regardless of whether + they are found in the UNIX passwd database. The fall- + back_transport_maps and fallback_transport parameters + specify an optional message transport for recipients that + are not found in the aliases(5) or UNIX passwd database. In the case of UNIX-style mailbox delivery, the local(8) daemon prepends a "From sender time_stamp" envelope header @@ -351,7 +353,7 @@ LOCAL(8) LOCAL(8) broken by the use of the Delivered-To: message header. CONFIGURATION PARAMETERS - Changes to main.cf are picked up automatically, as + Changes to main.cf are picked up automatically, as local(8) processes run for only a limited amount of time. Use the command "postfix reload" to speed up a change. @@ -388,9 +390,10 @@ LOCAL(8) LOCAL(8) DELIVERY METHOD CONTROLS The precedence of local(8) delivery methods from high to - low is: aliases, .forward files, mailbox_transport, mail- - box_command_maps, mailbox_command, home_mailbox, - mail_spool_directory, fallback_transport and luser_relay. + low is: aliases, .forward files, mailbox_transport_maps, + mailbox_transport, mailbox_command_maps, mailbox_command, + home_mailbox, mail_spool_directory, fallback_trans- + port_maps, fallback_transport, and luser_relay. alias_maps (see 'postconf -d' output) The alias databases that are used for local(8) @@ -401,33 +404,45 @@ LOCAL(8) LOCAL(8) a .forward file with user-specified delivery meth- ods. + mailbox_transport_maps (empty) + Optional lookup tables with per-recipient message + delivery transports to use for local(8) mailbox + delivery, whether or not the recipients are found + in the UNIX passwd database. + mailbox_transport (empty) - Optional message delivery transport that the - local(8) delivery agent should use for mailbox - delivery to all local recipients, whether or not + Optional message delivery transport that the + local(8) delivery agent should use for mailbox + delivery to all local recipients, whether or not they are found in the UNIX passwd database. mailbox_command_maps (empty) - Optional lookup tables with per-recipient external + Optional lookup tables with per-recipient external commands to use for local(8) mailbox delivery. mailbox_command (empty) - Optional external command that the local(8) deliv- + Optional external command that the local(8) deliv- ery agent should use for mailbox delivery. home_mailbox (empty) - Optional pathname of a mailbox file relative to a + Optional pathname of a mailbox file relative to a local(8) user's home directory. mail_spool_directory (see 'postconf -d' output) - The directory where local(8) UNIX-style mailboxes + The directory where local(8) UNIX-style mailboxes are kept. + fallback_transport_maps (empty) + Optional lookup tables with per-recipient message + delivery transports for recipients that the + local(8) delivery agent could not find in the + aliases(5) or UNIX password database. + fallback_transport (empty) Optional message delivery transport that the local(8) delivery agent should use for names that - are not found in the aliases(5) database or in the - UNIX passwd database. + are not found in the aliases(5) or UNIX password + database. luser_relay (empty) Optional catch-all destination for unknown local(8) @@ -492,8 +507,8 @@ LOCAL(8) LOCAL(8) command_expansion_filter (see 'postconf -d' output) Restrict the characters that the local(8) delivery - agent allows in $name expansions of $mailbox_com- - mand. + agent allows in $name expansions of $mailbox_com- + mand. default_privs (nobody) The default rights used by the local(8) delivery @@ -513,8 +528,8 @@ LOCAL(8) LOCAL(8) MISCELLANEOUS CONTROLS config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and - master.cf configuration files. + The default location of the Postfix main.cf and + master.cf configuration files. daemon_timeout (18000s) How much time a Postfix daemon process may take to diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index fb8c14ab4..44758e17e 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -1004,7 +1004,7 @@ the Postfix SMTP client returns such mail as undeliverable. Specify, for example, "best_mx_transport = local" to pass the mail from the SMTP client to the local(8) delivery agent. You can specify any message delivery "transport" or "transport:nexthop" that is -defined in the master.cf file. See the transport(5) manual page +defined in the master.cf file. See the transport(5) manual page for the syntax and meaning of "transport" or "transport:nexthop".
@@ -1030,7 +1030,7 @@ notification with the UNIX command "biff y".For compatibility reasons this feature is on by default. On systems with lots of interactive users, the biff service can be a performance -drain. Specify "biff = no" in main.cf to disable. +drain. Specify "biff = no" in main.cf to disable.
@@ -1355,7 +1355,7 @@ global ipc_timeout parameter as well.- config_directory (default: see "postconf -d" output)
- -
@@ -1714,7 +1714,7 @@ PRIVILEGED USER OR THE POSTFIX OWNER.The default location of the Postfix main.cf and master.cf +
The default location of the Postfix main.cf and master.cf configuration files. This can be overruled via the following mechanisms:
@@ -1371,7 +1371,7 @@ and commands).With Postfix command that run with set-gid privileges, a config_directory override requires either root privileges, or it requires that the directory is listed with the alternate_config_directories -parameter in the default main.cf file.
+parameter in the default main.cf file.The default maximal number of Postfix child processes that provide a given service. This limit can be overruled for specific services -in the master.cf file. +in the master.cf file.
@@ -1876,7 +1876,7 @@ table.Specify a string of the form transport:nexthop, where transport -is the name of a mail delivery transport defined in master.cf. +is the name of a mail delivery transport defined in master.cf. The :nexthop part is optional. For more details see the transport(5) manual page.
@@ -1945,7 +1945,7 @@ This feature is available in Postfix 2.0 and later. The names of message delivery transports that should not deliver mail unless someone issues "sendmail -q" or equivalent. Specify zero or more names of mail delivery transports names that appear in the -first field of master.cf. +first field of master.cf.@@ -2339,9 +2339,9 @@ is unavailable.
-
- - -- In main.cf specify "relay_transport = relay", +
- In main.cf specify "relay_transport = relay", -
- In master.cf specify "-o fallback_relay =" (i.e., empty) at +
- In master.cf specify "-o fallback_relay =" (i.e., empty) at the end of the relay entry.
- In transport maps, specify "relay:nexthop..." @@ -2362,9 +2362,31 @@ for destinations that it is MX host for.
Optional message delivery transport that the local(8) delivery agent should use for names that are not found in the aliases(5) -database or in the UNIX passwd database. +or UNIX password database.
+The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
+ + + + +- fallback_transport_maps +(default: empty)
- + +
@@ -2684,12 +2706,10 @@ home directory. Specify a pathname ending in "/" for qmail-style delivery. -Optional lookup tables with per-recipient message delivery +transports for recipients that the local(8) delivery agent could +not find in the aliases(5) or UNIX password database.
+ +The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
+ +This feature is available in Postfix 2.3 and later.
+-The precedence of local(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. -
+The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
Examples: @@ -2832,7 +2852,7 @@ for IPv6.
A better solution for multi-homed firewalls is to leave inet_interfaces at the default value and instead use explicit IP addresses in -the master.cf SMTP server definitions. This preserves the SMTP client's +the master.cf SMTP server definitions. This preserves the SMTP client's loop detection, by ensuring that each side of the firewall knows that the other IP address is still the same host. Setting $inet_interfaces to a single IPv4 and/or IPV6 address is primarily useful with virtual @@ -3196,7 +3216,7 @@ configuration parameter. See there for details.
The maximal number of parallel deliveries to the same destination via the lmtp message delivery transport. This limit is enforced by the queue manager. The message delivery transport name is the first -field in the entry in the master.cf file.
+field in the entry in the master.cf file. @@ -3207,7 +3227,7 @@ field in the entry in the master.cf file.The maximal number of recipients per delivery via the lmtp message delivery transport. This limit is enforced by the queue manager. The message delivery transport name is the first field in -the entry in the master.cf file.
+the entry in the master.cf file.Setting this parameter to a value of 1 changes the meaning of lmtp_destination_concurrency_limit from concurrency per domain into @@ -3253,15 +3273,6 @@ discard LHLO keywords selectively.
- lmtp_dot_quit_workaround_threshold_time -(default: 3000s)
- - -
The LMTP-specific version of the smtp_dot_quit_workaround_threshold_time -configuration parameter. See there for details.
- -- lmtp_enforce_tls @@ -3310,13 +3321,13 @@ The default value is the machine hostname. Specify a hostname or
-This information can be specified in the main.cf file for all LMTP -clients, or it can be specified in the master.cf file for a specific +This information can be specified in the main.cf file for all LMTP +clients, or it can be specified in the master.cf file for a specific client, for example:
- /etc/postfix/master.cf: + /etc/postfix/master.cf: mylmtp ... lmtp -o lmtp_lhlo_name=foo.bar.com@@ -3783,7 +3794,7 @@ delivery transport to the same recipient (when parallel deliveries to the same local domain (when "local_destination_recipient_limit > 1"). This limit is enforced by the queue manager. The message delivery transport name is the first -field in the entry in the master.cf file. +field in the entry in the master.cf file.A low limit of 2 is recommended, just in case someone has an expensive shell command in a .forward file or in an alias (e.g., @@ -3799,7 +3810,7 @@ the same time.
The maximal number of recipients per message delivery via the local mail delivery transport. This limit is enforced by the queue manager. The message delivery transport name is the first field in -the entry in the master.cf file.
+the entry in the master.cf file.Setting this parameter to a value > 1 changes the meaning of local_destination_concurrency_limit from concurrency per recipient @@ -3933,9 +3944,9 @@ delivery agent for local delivery. You need to update the
-
- - -- You redefine the local delivery agent in master.cf. +
- You redefine the local delivery agent in master.cf. -
- You redefine the "local_transport" setting in main.cf. +
- You redefine the "local_transport" setting in main.cf.
- You use the "luser_relay", "mailbox_transport", or "fallback_transport" feature of the Postfix local(8) delivery agent. @@ -3974,12 +3985,12 @@ This information can be overruled with the transport(
By default, local mail is delivered to the transport called "local", -which is just the name of a service that is defined the master.cf file. +which is just the name of a service that is defined the master.cf file.
Specify a string of the form transport:nexthop, where transport -is the name of a mail delivery transport defined in master.cf. +is the name of a mail delivery transport defined in master.cf. The :nexthop part is optional. For more details see the transport(5) manual page.
@@ -4062,7 +4073,7 @@ Note: luser_relay works only for the PNote: if you use this feature for accounts not in the UNIX password file, then you must specify "local_recipient_maps =" (i.e. empty) -in the main.cf file, otherwise the Postfix SMTP server will reject mail +in the main.cf file, otherwise the Postfix SMTP server will reject mail for non-UNIX accounts with "User unknown in local recipient table".
@@ -4271,12 +4282,10 @@ system-wide, you must set up an alias that forwards mail for root to a real user. --The precedence of local(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. -
+The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
Examples: @@ -4300,12 +4309,10 @@ Optional lookup tables with per-recipient external commands to use for local(8) mailbox delivery. Behavior is as with mailbox_command.
--The precedence of local(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. -
+The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
@@ -4361,12 +4368,27 @@ agent should use for mailbox delivery to all local recipients, whether or not they are found in the UNIX passwd database. --The precedence of local(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. -
+The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
+ + + + +- mailbox_transport_maps +(default: empty)
- + +
@@ -5545,11 +5567,11 @@ configure or operate a specific Postfix subsystem or feature.Optional lookup tables with per-recipient message delivery +transports to use for local(8) mailbox delivery, whether or not the +recipients are found in the UNIX passwd database.
+ +The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
+ +This feature is available in Postfix 2.3 and later.
Enable or disable recipient validation, built-in content filtering, or address mapping. Typically, these are specified in -master.cf as command-line arguments for the smtpd(8), qmqpd(8) or +master.cf as command-line arguments for the smtpd(8), qmqpd(8) or pickup(8) daemons.
Specify zero or more of the following options. The options -override main.cf settings and are either implemented by smtpd(8), +override main.cf settings and are either implemented by smtpd(8), qmqpd(8), or pickup(8) themselves, or they are forwarded to the cleanup server.
@@ -5577,8 +5599,8 @@ an external content filter.Note: when the "BEFORE content filter" receive_override_options -setting is specified in the main.cf file, specify the "AFTER content -filter" receive_override_options setting in master.cf (and vice +setting is specified in the main.cf file, specify the "AFTER content +filter" receive_override_options setting in master.cf (and vice versa).
@@ -5774,7 +5796,7 @@ See RESTRICTION_CLASS_README.The maximal number of parallel deliveries to the same destination via the relay message delivery transport. This limit is enforced by the queue manager. The message delivery transport name is the -first field in the entry in the master.cf file.
+first field in the entry in the master.cf file.This feature is available in Postfix 2.0 and later.
@@ -5787,7 +5809,7 @@ first field in the entry in the master.cf file.The maximal number of recipients per delivery via the relay message delivery transport. This limit is enforced by the queue manager. The message delivery transport name is the first field in -the entry in the master.cf file.
+the entry in the master.cf file.Setting this parameter to a value of 1 changes the meaning of relay_destination_concurrency_limit from concurrency per domain @@ -5893,7 +5915,7 @@ the transport(5) table.
Specify a string of the form transport:nexthop, where transport -is the name of a mail delivery transport defined in master.cf. +is the name of a mail delivery transport defined in master.cf. The :nexthop part is optional. For more details see the transport(5) manual page.
@@ -6324,13 +6346,13 @@ bind to when making an IPv4 connection.-This can be specified in the main.cf file for all SMTP clients, or -it can be specified in the master.cf file for a specific client, +This can be specified in the main.cf file for all SMTP clients, or +it can be specified in the master.cf file for a specific client, for example:
- /etc/postfix/master.cf: + /etc/postfix/master.cf: smtp ... smtp -o smtp_bind_address=11.22.33.44@@ -6357,13 +6379,13 @@ bind to when making an IPv6 connection.This feature is available in Postfix 2.2 and later.
-This can be specified in the main.cf file for all SMTP clients, or -it can be specified in the master.cf file for a specific client, +This can be specified in the main.cf file for all SMTP clients, or +it can be specified in the master.cf file for a specific client, for example:
- /etc/postfix/master.cf: + /etc/postfix/master.cf: smtp ... smtp -o smtp_bind_address6=1:2:3:4:5:6:7:8@@ -6422,7 +6444,7 @@ right-hand side of an email address, without the [] around a numeric IP address),- if mail is sent via a relay host: a relay host name (without -[] or non-default TCP port), as specified in main.cf or in the +[] or non-default TCP port), as specified in main.cf or in the transport map,
- if mail is sent via a UNIX-domain socket: a pathname (without @@ -6621,7 +6643,7 @@ This feature is available in Postfix 2.1 and later.
The maximal number of parallel deliveries to the same destination via the smtp message delivery transport. This limit is enforced by the queue manager. The message delivery transport name is the first -field in the entry in the master.cf file.
+field in the entry in the master.cf file. @@ -6632,7 +6654,7 @@ field in the entry in the master.cf file.The maximal number of recipients per delivery via the smtp message delivery transport. This limit is enforced by the queue manager. The message delivery transport name is the first field in -the entry in the master.cf file.
+the entry in the master.cf file.Setting this parameter to a value of 1 changes the meaning of smtp_destination_concurrency_limit from concurrency per domain @@ -6678,39 +6700,6 @@ discard EHLO keywords selectively.
- smtp_dot_quit_workaround_threshold_time -(default: 3000s)
- - -
How long a message must be queued before the "." + QUIT bug -workaround is turned on for all deliveries; this limits the -number of repeated deliveries with servers or firewalls that -mis-implement END-OF-DATA + QUIT pipelining.
- -When the workaround is turned on, the Postfix SMTP client will -not send the QUIT command until it has received the server's -END-OF-DATA reply. This workaround incurs a small performance loss -with delivery to sites that correctly implement SMTP command -pipelining.
- -By default, the workaround is turned off for mail that is queued -for less than 3000 seconds. In other words, the workaround is -normally turned off for the first few delivery attempts of personal -mail and of small mailing lists.
- -Specify 0 to enable this workaround upon the first delivery -attempt, and specify a large value such as $maximal_queue_lifetime -to disable the workaround for practically all delivery attempts. -
- -Note: when the smtp_fallback_relay feature is used, there will -be no second delivery attempt, and the workaround may have no effect. -
- -This feature is available in Postfix 2.3 and later.
- -- smtp_enforce_tls @@ -6794,13 +6783,13 @@ The default value is the machine hostname. Specify a hostname or
-This information can be specified in the main.cf file for all SMTP -clients, or it can be specified in the master.cf file for a specific +This information can be specified in the main.cf file for all SMTP +clients, or it can be specified in the master.cf file for a specific client, for example:
- /etc/postfix/master.cf: + /etc/postfix/master.cf: mysmtp ... smtp -o smtp_helo_name=foo.bar.com@@ -7004,11 +6993,11 @@ that ends in ".".The default is to comply with RFC 821. If you have to send mail to -a broken SMTP server, configure a special SMTP client in master.cf: +a broken SMTP server, configure a special SMTP client in master.cf:
- /etc/postfix/master.cf: + /etc/postfix/master.cf: broken-smtp . . . smtp -o smtp_quote_rfc821_envelope=no@@ -8173,7 +8162,7 @@ the next restriction in the list, if any. This may stop zombie mail when used as:-/etc/postfix/main.cf: +/etc/postfix/main.cf: smtpd_client_restrictions = sleep 1, reject_unauth_pipelining smtpd_delay_reject = no @@ -9879,7 +9868,7 @@ $smtpd_tls_session_cac instead of using the STARTTLS command.If you want to support this service, enable a special port in -master.cf, and specify "-o smtpd_tls_wrappermode=yes" on the SMTP +master.cf, and specify "-o smtpd_tls_wrappermode=yes" on the SMTP server's command line. Port 465 (smtps) was once chosen for this purpose.
@@ -10104,7 +10093,7 @@ Warning: a non-default syslog_facility 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. +errors while accessing the Postfix main.cf configuration file. @@ -10123,7 +10112,7 @@ Warning: a non-default syslog_name set a Postfix process has completed initialization. Errors during process initialization will be logged with the default name. Examples are errors while parsing the command line arguments, and errors -while accessing the Postfix main.cf configuration file. +while accessing the Postfix main.cf configuration file. @@ -10600,7 +10589,7 @@ This feature is available in Postfix 2.1 and later.The maximal number of parallel deliveries to the same destination via the virtual message delivery transport. This limit is enforced by the queue manager. The message delivery transport name is the -first field in the entry in the master.cf file.
+first field in the entry in the master.cf file. @@ -10611,7 +10600,7 @@ first field in the entry in the master.cf file.The maximal number of recipients per delivery via the virtual message delivery transport. This limit is enforced by the queue manager. The message delivery transport name is the first field in -the entry in the master.cf file.
+the entry in the master.cf file.Setting this parameter to a value of 1 changes the meaning of virtual_destination_concurrency_limit from concurrency per domain @@ -10821,7 +10810,7 @@ This information can be overruled with the transport(
5 6 # Localize these. The -G option does nothing before Postfix 2.3. 7 INSPECT_DIR=/var/spool/filter - 8 SENDMAIL="/usr/sbin/sendmail -G -i" + 8 SENDMAIL="/usr/sbin/sendmail -G -i" # NEVER NEVER NEVER use "-t" here. 9 10 # Exit codes from <sysexits.h> 11 EX_TEMPFAIL=75 @@ -288,6 +288,10 @@ otherwise it disables address rewriting of message headers.Specify a string of the form transport:nexthop, where transport -is the name of a mail delivery transport defined in master.cf. +is the name of a mail delivery transport defined in master.cf. The :nexthop part is optional. For more details see the transport(5) manual page.
diff --git a/postfix/html/smtp.8.html b/postfix/html/smtp.8.html index 4ed672cfb..9c0b5d460 100644 --- a/postfix/html/smtp.8.html +++ b/postfix/html/smtp.8.html @@ -145,7 +145,7 @@ SMTP(8) SMTP(8) document describes only those LMTP-related parameters that aren't simply "ghost" parameters. - Changes to main.cf are picked up automatically, as smtp(8) + Changes to main.cf are picked up automatically, as smtp(8) processes run for only a limited amount of time. Use the command "postfix reload" to speed up a change. @@ -166,13 +166,6 @@ SMTP(8) SMTP(8) Defer mail delivery when no MX record resolves to an IP address. - smtp_dot_quit_workaround_threshold_time (3000s) - How long a message must be queued before the "." + - QUIT bug workaround is turned on for all deliver- - ies; this limits the number of repeated deliveries - with servers or firewalls that mis-implement END- - OF-DATA + QUIT pipelining. - smtp_line_length_limit (990) The maximal length of message header and body lines that Postfix will send via SMTP. @@ -533,8 +526,8 @@ SMTP(8) SMTP(8) condition. config_directory (see 'postconf -d' output) - The default location of the Postfix main.cf and - master.cf configuration files. + The default location of the Postfix main.cf and + master.cf configuration files. daemon_timeout (18000s) How much time a Postfix daemon process may take to diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index 9bfc3e523..7e1dece6e 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -1270,7 +1270,23 @@ for destinations that it is MX host for. .SH fallback_transport (default: empty) Optional message delivery transport that the \fBlocal\fR(8) delivery agent should use for names that are not found in the \fBaliases\fR(5) -database or in the UNIX passwd database. +or UNIX password database. +.PP +The precedence of \fBlocal\fR(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay. +.SH fallback_transport_maps (default: empty) +Optional lookup tables with per-recipient message delivery +transports for recipients that the \fBlocal\fR(8) delivery agent could +not find in the \fBaliases\fR(5) or UNIX password database. +.PP +The precedence of \fBlocal\fR(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay. +.PP +This feature is available in Postfix 2.3 and later. .SH fast_flush_domains (default: $relay_domains) Optional list of destinations that are eligible for per-destination logfiles with mail that is queued to those destinations. @@ -1421,10 +1437,10 @@ home directory. .PP Specify a pathname ending in "/" for qmail-style delivery. .PP -The precedence of \fBlocal\fR(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. +The precedence of \fBlocal\fR(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay. .PP Examples: .PP @@ -1746,9 +1762,6 @@ this action from being logged. .IP \(bu Use the lmtp_discard_lhlo_keyword_address_maps feature to discard LHLO keywords selectively. -.SH lmtp_dot_quit_workaround_threshold_time (default: 3000s) -The LMTP-specific version of the smtp_dot_quit_workaround_threshold_time -configuration parameter. See there for details. .SH lmtp_enforce_tls (default: no) The LMTP-specific version of the smtp_enforce_tls configuration parameter. See there for details. @@ -2309,10 +2322,10 @@ Note: if you use the mailbox_command feature to deliver mail system-wide, you must set up an alias that forwards mail for root to a real user. .PP -The precedence of \fBlocal\fR(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. +The precedence of \fBlocal\fR(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay. .PP Examples: .PP @@ -2330,10 +2343,10 @@ mailbox_command = /some/where/maildrop -d "$USER" Optional lookup tables with per-recipient external commands to use for \fBlocal\fR(8) mailbox delivery. Behavior is as with mailbox_command. .PP -The precedence of \fBlocal\fR(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. +The precedence of \fBlocal\fR(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay. .SH mailbox_delivery_lock (default: see "postconf -d" output) How to lock a UNIX-style \fBlocal\fR(8) mailbox before attempting delivery. For a list of available file locking methods, use the "\fBpostconf @@ -2359,10 +2372,21 @@ Optional message delivery transport that the \fBlocal\fR(8) delivery agent should use for mailbox delivery to all local recipients, whether or not they are found in the UNIX passwd database. .PP -The precedence of \fBlocal\fR(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. +The precedence of \fBlocal\fR(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay. +.SH mailbox_transport_maps (default: empty) +Optional lookup tables with per-recipient message delivery +transports to use for \fBlocal\fR(8) mailbox delivery, whether or not the +recipients are found in the UNIX passwd database. +.PP +The precedence of \fBlocal\fR(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay. +.PP +This feature is available in Postfix 2.3 and later. .SH mailq_path (default: see "postconf -d" output) Sendmail compatibility feature that specifies where the Postfix \fBmailq\fR(1) command is installed. This command can be used to @@ -3723,31 +3747,6 @@ this action from being logged. .IP \(bu Use the smtp_discard_ehlo_keyword_address_maps feature to discard EHLO keywords selectively. -.SH smtp_dot_quit_workaround_threshold_time (default: 3000s) -How long a message must be queued before the "." + QUIT bug -workaround is turned on for all deliveries; this limits the -number of repeated deliveries with servers or firewalls that -mis-implement END-OF-DATA + QUIT pipelining. -.PP -When the workaround is turned on, the Postfix SMTP client will -not send the QUIT command until it has received the server's -END-OF-DATA reply. This workaround incurs a small performance loss -with delivery to sites that correctly implement SMTP command -pipelining. -.PP -By default, the workaround is turned off for mail that is queued -for less than 3000 seconds. In other words, the workaround is -normally turned off for the first few delivery attempts of personal -mail and of small mailing lists. -.PP -Specify 0 to enable this workaround upon the first delivery -attempt, and specify a large value such as $maximal_queue_lifetime -to disable the workaround for practically all delivery attempts. -.PP -Note: when the smtp_fallback_relay feature is used, there will -be no second delivery attempt, and the workaround may have no effect. -.PP -This feature is available in Postfix 2.3 and later. .SH smtp_enforce_tls (default: no) Enforcement mode: require that remote SMTP servers use TLS encryption, and never send mail in the clear. This also requires diff --git a/postfix/man/man8/local.8 b/postfix/man/man8/local.8 index 17ebdc14e..586d1d2dc 100644 --- a/postfix/man/man8/local.8 +++ b/postfix/man/man8/local.8 @@ -113,18 +113,23 @@ configuration parameter. Specify a relative path name. Specify a name ending in \fB/\fR for \fBqmail\fR-compatible \fBmaildir\fR delivery. Mailbox delivery can be delegated to an external command specified -with the \fBmailbox_command\fR configuration parameter. The command +with the \fBmailbox_command_maps\fR and \fBmailbox_command\fR +configuration parameters. The command executes with the privileges of the recipient user (exceptions: secondary groups are not enabled; in case of delivery as root, the command executes with the privileges of \fBdefault_privs\fR). Mailbox delivery can be delegated to alternative message transports specified in the \fBmaster.cf\fR file. -The \fBmailbox_transport\fR configuration parameter specifies a +The \fBmailbox_transport_maps\fR and \fBmailbox_transport\fR +configuration parameters specify an optional message transport that is to be used for all local recipients, regardless of whether they are found in the UNIX passwd database. -The \fBfallback_transport\fR parameter specifies a message transport -for recipients that are not found in the UNIX passwd database. +The \fBfallback_transport_maps\fR and +\fBfallback_transport\fR parameters specify an optional +message transport +for recipients that are not found in the aliases(5) or UNIX +passwd database. In the case of UNIX-style mailbox delivery, the \fBlocal\fR(8) daemon prepends a "\fBFrom \fIsender time_stamp\fR" @@ -405,14 +410,19 @@ expanding aliases or .forward files. .ad .fi The precedence of \fBlocal\fR(8) delivery methods from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. +aliases, .forward files, mailbox_transport_maps, +mailbox_transport, mailbox_command_maps, mailbox_command, +home_mailbox, mail_spool_directory, fallback_transport_maps, +fallback_transport, and luser_relay. .IP "\fBalias_maps (see 'postconf -d' output)\fR" The alias databases that are used for \fBlocal\fR(8) delivery. .IP "\fBforward_path (see 'postconf -d' output)\fR" The \fBlocal\fR(8) delivery agent search list for finding a .forward file with user-specified delivery methods. +.IP "\fBmailbox_transport_maps (empty)\fR" +Optional lookup tables with per-recipient message delivery +transports to use for \fBlocal\fR(8) mailbox delivery, whether or not the +recipients are found in the UNIX passwd database. .IP "\fBmailbox_transport (empty)\fR" Optional message delivery transport that the \fBlocal\fR(8) delivery agent should use for mailbox delivery to all local recipients, @@ -428,10 +438,14 @@ Optional pathname of a mailbox file relative to a \fBlocal\fR(8) user's home directory. .IP "\fBmail_spool_directory (see 'postconf -d' output)\fR" The directory where \fBlocal\fR(8) UNIX-style mailboxes are kept. +.IP "\fBfallback_transport_maps (empty)\fR" +Optional lookup tables with per-recipient message delivery +transports for recipients that the \fBlocal\fR(8) delivery agent could +not find in the \fBaliases\fR(5) or UNIX password database. .IP "\fBfallback_transport (empty)\fR" Optional message delivery transport that the \fBlocal\fR(8) delivery agent should use for names that are not found in the \fBaliases\fR(5) -database or in the UNIX passwd database. +or UNIX password database. .IP "\fBluser_relay (empty)\fR" Optional catch-all destination for unknown \fBlocal\fR(8) recipients. .PP diff --git a/postfix/man/man8/smtp.8 b/postfix/man/man8/smtp.8 index 5126a27cb..0b3b09396 100644 --- a/postfix/man/man8/smtp.8 +++ b/postfix/man/man8/smtp.8 @@ -162,11 +162,6 @@ Always send EHLO at the start of an SMTP session. Never send EHLO at the start of an SMTP session. .IP "\fBsmtp_defer_if_no_mx_address_found (no)\fR" Defer mail delivery when no MX record resolves to an IP address. -.IP "\fBsmtp_dot_quit_workaround_threshold_time (3000s)\fR" -How long a message must be queued before the "." + QUIT bug -workaround is turned on for all deliveries; this limits the -number of repeated deliveries with servers or firewalls that -mis-implement END-OF-DATA + QUIT pipelining. .IP "\fBsmtp_line_length_limit (990)\fR" The maximal length of message header and body lines that Postfix will send via SMTP. diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index 405b2dbe2..c2c674a05 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -161,8 +161,9 @@ while (<>) { s;\berror_service_name\b;$&;g; s;\bexpand_owner_alias\b;$&;g; s;\bexport_environment\b;$&;g; - s;\bfallback_relay\b;$&;g; - s;\bfallback_transport\b;$&;g; + s;\bfall[-]*\n* *[]*back_relay\b;$&;g; + s;\bfall[- ]*\n* *[]*back_transport\b;$&;g; + s;\bfall[- ]*\n* *[]*back_transport_maps\b;$&;g; s;\bfast_flush_domains\b;$&;g; s;\bfast_flush_purge_time\b;$&;g; s;\bfast_flush_refresh_time\b;$&;g; @@ -252,11 +253,12 @@ while (<>) { s;\bmail_release_date\b;$&;g; s;\bmail_spool_direc[- ]*\n* *[]*tory\b;$&;g; s;\bmail_version\b;$&;g; - s;\bmail[- ]*\n* *[]*box_command\b;$&;g; - s;\bmail[- ]*\n* *[]*box_command_maps\b;$&;g; + s;\bmail[- ]*\n* *[]*box_com[- ]*\n* *[]*mand\b;$&;g; + s;\bmail[- ]*\n* *[]*box_com[- ]*\n* *[]*mand_maps\b;$&;g; s;\bmail[- ]*\n* *[]*box_deliv[- ]*\n* *[]*ery_lock\b;$&;g; s;\bmail[- ]*\n* *[]*box_size_limit\b;$&;g; s;\bmail[- ]*\n* *[]*box_transport\b;$&;g; + s;\bmail[- ]*\n* *[]*box_transport_maps\b;$&;g; s;\bmailq_path\b;$&;g; s;\bmanpage_directory\b;$&;g; s;\bmaps_rbl_domains\b;$&;g; @@ -387,7 +389,6 @@ while (<>) { s;\bsmtp_mx_session_limit\b;$&;g; s;\bsmtp_never_send_ehlo\b;$&;g; s;\bsmtp_sender_depen[- ]*\n*[]*dent_authentication\b;$&;g; - s;\bsmtp_dot_quit_workaround_threshold_time\b;$&;g; s;\bsmtp_pix_workaround_delay_time\b;$&;g; s;\bsmtp_pix_workaround_threshold_time\b;$&;g; s;\bsmtp_quit_timeout\b;$&;g; @@ -627,6 +628,9 @@ while (<>) { s/[ ]*body_checks[<\/bB>]*\(5\)/$&<\/a>/g; s/[ ]*header_checks[<\/bB>]*\(5\)/$&<\/a>/g; + s/[ ]*main\.cf[<\/bB>]*/$&<\/a>/g; + s/[ ]*master\.cf[<\/bB>]*/$&<\/a>/g; + # Hyperlink README document names s/\b([A-Z][A-Z0-9_]*)[-]*\n*[ ]*([A-Z0-9_]*_README)\b/$&<\/a>/g; diff --git a/postfix/proto/FILTER_README.html b/postfix/proto/FILTER_README.html index c028ee5af..0405e2838 100644 --- a/postfix/proto/FILTER_README.html +++ b/postfix/proto/FILTER_README.html @@ -252,7 +252,7 @@ document for an introduction to the Postfix architecture. Line 8: The -i option says don't stop reading input when a line contains "." only.
+Line 8: NEVER NEVER NEVER use the "-t" command-line option +here. It will mis-deliver mail, like sending mailing list mail back +to the mailing list.
+Line 21: The idea is to first capture the message to file and then run the content through a third-party content filter program.
@@ -623,7 +627,8 @@ gobble up a lot of system resources, so you don't want to have too much of it running at the same time.With "-o smtp_send_xforward_command=yes", the scan transport -will try to forward the original client name and IP address to the +will try to forward the original client name and IP address +through the content filter to the after-filter smtpd process, so that filtered mail is logged with the real client name IP address. See smtp(8) and XFORWARD_README for more information.
diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index 1294e41f0..65e620d06 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -1588,12 +1588,10 @@ home directory. Specify a pathname ending in "/" for qmail-style delivery. --The precedence of local(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. -
+The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
Examples: @@ -2389,12 +2387,10 @@ system-wide, you must set up an alias that forwards mail for root to a real user.
--The precedence of local(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. -
+The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
Examples: @@ -6659,8 +6655,13 @@ sender address to the name of the "owner-aliasname" alias.
Optional message delivery transport that the local(8) delivery agent should use for names that are not found in the aliases(5) -database or in the UNIX passwd database. +or UNIX password database.
+ +The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
%PARAM fault_injection_code 0 @@ -6820,12 +6821,10 @@ Optional lookup tables with per-recipient external commands to use for local(8) mailbox delivery. Behavior is as with mailbox_command. --The precedence of local(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. -
+The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
%PARAM mailbox_delivery_lock see "postconf -d" output @@ -6857,12 +6856,10 @@ agent should use for mailbox delivery to all local recipients, whether or not they are found in the UNIX passwd database. --The precedence of local(8) delivery features from high to low is: -aliases, .forward files, mailbox_transport, mailbox_command_maps, -mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -and luser_relay. -
+The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
%PARAM mailq_path see "postconf -d" output @@ -9126,36 +9123,28 @@ rejecting the address as invalid.This feature is available in Postfix 2.3 and later. -%PARAM smtp_dot_quit_workaround_threshold_time 3000s - -
How long a message must be queued before the "." + QUIT bug -workaround is turned on for all deliveries; this limits the -number of repeated deliveries with servers or firewalls that -mis-implement END-OF-DATA + QUIT pipelining.
- -When the workaround is turned on, the Postfix SMTP client will -not send the QUIT command until it has received the server's -END-OF-DATA reply. This workaround incurs a small performance loss -with delivery to sites that correctly implement SMTP command -pipelining.
- -By default, the workaround is turned off for mail that is queued -for less than 3000 seconds. In other words, the workaround is -normally turned off for the first few delivery attempts of personal -mail and of small mailing lists.
- -Specify 0 to enable this workaround upon the first delivery -attempt, and specify a large value such as $maximal_queue_lifetime -to disable the workaround for practically all delivery attempts. -
- -Note: when the smtp_fallback_relay feature is used, there will -be no second delivery attempt, and the workaround may have no effect. -
+%PARAM mailbox_transport_maps +Optional lookup tables with per-recipient message delivery +transports to use for local(8) mailbox delivery, whether or not the +recipients are found in the UNIX passwd database.
+ +The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
+This feature is available in Postfix 2.3 and later.
-%PARAM lmtp_dot_quit_workaround_threshold_time 3000s +%PARAM fallback_transport_maps -The LMTP-specific version of the smtp_dot_quit_workaround_threshold_time -configuration parameter. See there for details.
+Optional lookup tables with per-recipient message delivery +transports for recipients that the local(8) delivery agent could +not find in the aliases(5) or UNIX password database.
+ +The precedence of local(8) delivery features from high to low +is: aliases, .forward files, mailbox_transport_maps, mailbox_transport, +mailbox_command_maps, mailbox_command, home_mailbox, mail_spool_directory, +fallback_transport_maps, fallback_transport and luser_relay.
+ +This feature is available in Postfix 2.3 and later.
diff --git a/postfix/src/anvil/anvil.c b/postfix/src/anvil/anvil.c index fb0aa89e6..d9e70e59d 100644 --- a/postfix/src/anvil/anvil.c +++ b/postfix/src/anvil/anvil.c @@ -937,6 +937,12 @@ static void post_jail_init(char *unused_name, char **unused_argv) * Do not limit the number of client requests. */ var_use_limit = 0; + + /* + * Don't exit before the sampling interval ends. + */ + if (var_idle_limit < var_anvil_time_unit) + var_idle_limit = var_anvil_time_unit; } /* main - pass control to the multi-threaded skeleton */ diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index acfa48531..97f39f26a 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -491,10 +491,18 @@ extern char *var_mailbox_cmd_maps; #define DEF_MAILBOX_TRANSP "" extern char *var_mailbox_transport; +#define VAR_MBOX_TRANSP_MAPS "mailbox_transport_maps" +#define DEF_MBOX_TRANSP_MAPS "" +extern char *var_mbox_transp_maps; + #define VAR_FALLBACK_TRANSP "fallback_transport" #define DEF_FALLBACK_TRANSP "" extern char *var_fallback_transport; +#define VAR_FBCK_TRANSP_MAPS "fallback_transport_maps" +#define DEF_FBCK_TRANSP_MAPS "" +extern char *var_fbck_transp_maps; + /* * Local delivery: path to per-user forwarding file. */ @@ -1006,12 +1014,6 @@ extern int var_smtp_pix_thresh; #define DEF_LMTP_PIX_DELAY "10s" extern int var_smtp_pix_delay; -#define VAR_SMTP_DOTQ_THRESH "smtp_dot_quit_workaround_threshold" -#define DEF_SMTP_DOTQ_THRESH "3000s" -#define VAR_LMTP_DOTQ_THRESH "lmtp_dot_quit_workaround_threshold" -#define DEF_LMTP_DOTQ_THRESH "3000s" -extern int var_smtp_dotq_thresh; - #define VAR_SMTP_DEFER_MXADDR "smtp_defer_if_no_mx_address_found" #define DEF_SMTP_DEFER_MXADDR 0 #define VAR_LMTP_DEFER_MXADDR "lmtp_defer_if_no_mx_address_found" diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 3bd0e8953..ee8ce66aa 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 "20051229" +#define MAIL_RELEASE_DATE "20060103" #define MAIL_VERSION_NUMBER "2.3" #ifdef SNAPSHOT diff --git a/postfix/src/local/local.c b/postfix/src/local/local.c index 5de53e485..759f71c34 100644 --- a/postfix/src/local/local.c +++ b/postfix/src/local/local.c @@ -101,18 +101,23 @@ /* ending in \fB/\fR for \fBqmail\fR-compatible \fBmaildir\fR delivery. /* /* Mailbox delivery can be delegated to an external command specified -/* with the \fBmailbox_command\fR configuration parameter. The command +/* with the \fBmailbox_command_maps\fR and \fBmailbox_command\fR +/* configuration parameters. The command /* executes with the privileges of the recipient user (exceptions: /* secondary groups are not enabled; in case of delivery as root, /* the command executes with the privileges of \fBdefault_privs\fR). /* /* Mailbox delivery can be delegated to alternative message transports /* specified in the \fBmaster.cf\fR file. -/* The \fBmailbox_transport\fR configuration parameter specifies a +/* The \fBmailbox_transport_maps\fR and \fBmailbox_transport\fR +/* configuration parameters specify an optional /* message transport that is to be used for all local recipients, /* regardless of whether they are found in the UNIX passwd database. -/* The \fBfallback_transport\fR parameter specifies a message transport -/* for recipients that are not found in the UNIX passwd database. +/* The \fBfallback_transport_maps\fR and +/* \fBfallback_transport\fR parameters specify an optional +/* message transport +/* for recipients that are not found in the aliases(5) or UNIX +/* passwd database. /* /* In the case of UNIX-style mailbox delivery, /* the \fBlocal\fR(8) daemon prepends a "\fBFrom \fIsender time_stamp\fR" @@ -371,14 +376,19 @@ /* .ad /* .fi /* The precedence of \fBlocal\fR(8) delivery methods from high to low is: -/* aliases, .forward files, mailbox_transport, mailbox_command_maps, -/* mailbox_command, home_mailbox, mail_spool_directory, fallback_transport -/* and luser_relay. +/* aliases, .forward files, mailbox_transport_maps, +/* mailbox_transport, mailbox_command_maps, mailbox_command, +/* home_mailbox, mail_spool_directory, fallback_transport_maps, +/* fallback_transport, and luser_relay. /* .IP "\fBalias_maps (see 'postconf -d' output)\fR" /* The alias databases that are used for \fBlocal\fR(8) delivery. /* .IP "\fBforward_path (see 'postconf -d' output)\fR" /* The \fBlocal\fR(8) delivery agent search list for finding a .forward /* file with user-specified delivery methods. +/* .IP "\fBmailbox_transport_maps (empty)\fR" +/* Optional lookup tables with per-recipient message delivery +/* transports to use for \fBlocal\fR(8) mailbox delivery, whether or not the +/* recipients are found in the UNIX passwd database. /* .IP "\fBmailbox_transport (empty)\fR" /* Optional message delivery transport that the \fBlocal\fR(8) delivery /* agent should use for mailbox delivery to all local recipients, @@ -394,10 +404,14 @@ /* home directory. /* .IP "\fBmail_spool_directory (see 'postconf -d' output)\fR" /* The directory where \fBlocal\fR(8) UNIX-style mailboxes are kept. +/* .IP "\fBfallback_transport_maps (empty)\fR" +/* Optional lookup tables with per-recipient message delivery +/* transports for recipients that the \fBlocal\fR(8) delivery agent could +/* not find in the \fBaliases\fR(5) or UNIX password database. /* .IP "\fBfallback_transport (empty)\fR" /* Optional message delivery transport that the \fBlocal\fR(8) delivery /* agent should use for names that are not found in the \fBaliases\fR(5) -/* database or in the UNIX passwd database. +/* or UNIX password database. /* .IP "\fBluser_relay (empty)\fR" /* Optional catch-all destination for unknown \fBlocal\fR(8) recipients. /* .PP @@ -604,7 +618,9 @@ char *var_luser_relay; int var_biff; char *var_mail_spool_dir; char *var_mailbox_transport; +char *var_mbox_transp_maps; char *var_fallback_transport; +char *var_fbck_transp_maps; char *var_exec_directory; char *var_exec_exp_filter; char *var_forward_path; @@ -843,13 +859,16 @@ int main(int argc, char **argv) VAR_LOCAL_CMD_SHELL, DEF_LOCAL_CMD_SHELL, &var_local_cmd_shell, 0, 0, VAR_MAIL_SPOOL_DIR, DEF_MAIL_SPOOL_DIR, &var_mail_spool_dir, 0, 0, VAR_MAILBOX_TRANSP, DEF_MAILBOX_TRANSP, &var_mailbox_transport, 0, 0, + VAR_MBOX_TRANSP_MAPS, DEF_MBOX_TRANSP_MAPS, &var_mbox_transp_maps, 0, 0, VAR_FALLBACK_TRANSP, DEF_FALLBACK_TRANSP, &var_fallback_transport, 0, 0, + VAR_FBCK_TRANSP_MAPS, DEF_FBCK_TRANSP_MAPS, &var_fbck_transp_maps, 0, 0, VAR_CMD_EXP_FILTER, DEF_CMD_EXP_FILTER, &var_cmd_exp_filter, 1, 0, VAR_FWD_EXP_FILTER, DEF_FWD_EXP_FILTER, &var_fwd_exp_filter, 1, 0, VAR_EXEC_EXP_FILTER, DEF_EXEC_EXP_FILTER, &var_exec_exp_filter, 1, 0, VAR_PROP_EXTENSION, DEF_PROP_EXTENSION, &var_prop_extension, 0, 0, VAR_DELIVER_HDR, DEF_DELIVER_HDR, &var_deliver_hdr, 0, 0, VAR_MAILBOX_LOCK, DEF_MAILBOX_LOCK, &var_mailbox_lock, 1, 0, + VAR_MAILBOX_CMD_MAPS, DEF_MAILBOX_CMD_MAPS, &var_mailbox_cmd_maps, 0, 0, 0, }; static CONFIG_BOOL_TABLE bool_table[] = { @@ -866,7 +885,6 @@ int main(int argc, char **argv) VAR_EXEC_DIRECTORY, DEF_EXEC_DIRECTORY, &var_exec_directory, 0, 0, VAR_FORWARD_PATH, DEF_FORWARD_PATH, &var_forward_path, 0, 0, VAR_MAILBOX_COMMAND, DEF_MAILBOX_COMMAND, &var_mailbox_command, 0, 0, - VAR_MAILBOX_CMD_MAPS, DEF_MAILBOX_CMD_MAPS, &var_mailbox_cmd_maps, 0, 0, VAR_LUSER_RELAY, DEF_LUSER_RELAY, &var_luser_relay, 0, 0, 0, }; diff --git a/postfix/src/local/mailbox.c b/postfix/src/local/mailbox.c index 9b43950a3..fc2119a69 100644 --- a/postfix/src/local/mailbox.c +++ b/postfix/src/local/mailbox.c @@ -245,6 +245,8 @@ int deliver_mailbox(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp) int status; struct mypasswd *mbox_pwd; char *path; + static MAPS *transp_maps; + const char *map_transport; static MAPS *cmd_maps; const char *map_command; @@ -266,6 +268,17 @@ int deliver_mailbox(LOCAL_STATE state, USER_ATTR usr_attr, int *statusp) /* * Delegate mailbox delivery to another message transport. */ + if (*var_mbox_transp_maps && transp_maps == 0) + transp_maps = maps_create(VAR_MBOX_TRANSP_MAPS, var_mbox_transp_maps, + DICT_FLAG_LOCK); + if (*var_mbox_transp_maps + && (map_transport = maps_find(transp_maps, state.msg_attr.user, + DICT_FLAG_FIXED)) != 0) { + state.msg_attr.rcpt.offset = -1L; + *statusp = deliver_pass(MAIL_CLASS_PRIVATE, map_transport, + state.request, &state.msg_attr.rcpt); + return (YES); + } if (*var_mailbox_transport) { state.msg_attr.rcpt.offset = -1L; *statusp = deliver_pass(MAIL_CLASS_PRIVATE, var_mailbox_transport, diff --git a/postfix/src/local/unknown.c b/postfix/src/local/unknown.c index 3821fcf2f..cc0a07458 100644 --- a/postfix/src/local/unknown.c +++ b/postfix/src/local/unknown.c @@ -84,6 +84,8 @@ int deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr) char *myname = "deliver_unknown"; int status; VSTRING *expand_luser; + static MAPS *transp_maps; + const char *map_transport; /* * Make verbose logging easier to understand. @@ -104,6 +106,15 @@ int deliver_unknown(LOCAL_STATE state, USER_ATTR usr_attr) * The fall-back transport specifies a delivery machanism that handles * users not found in the aliases or UNIX passwd databases. */ + if (*var_fbck_transp_maps && transp_maps == 0) + transp_maps = maps_create(VAR_FBCK_TRANSP_MAPS, var_fbck_transp_maps, + DICT_FLAG_LOCK); + if (*var_fbck_transp_maps + && (map_transport = maps_find(transp_maps, state.msg_attr.user, + DICT_FLAG_FIXED)) != 0) { + return (deliver_pass(MAIL_CLASS_PRIVATE, map_transport, + state.request, &state.msg_attr.rcpt)); + } if (*var_fallback_transport) { state.msg_attr.rcpt.offset = -1L; return (deliver_pass(MAIL_CLASS_PRIVATE, var_fallback_transport, diff --git a/postfix/src/master/master.h b/postfix/src/master/master.h index c1772722b..8470a189d 100644 --- a/postfix/src/master/master.h +++ b/postfix/src/master/master.h @@ -15,11 +15,21 @@ * when idle for a configurable amount of time, or after servicing a * configurable number of requests; the master process spawns new processes * on demand up to a configurable concurrency limit and/or periodically. + * + * The canonical service name is what we use internally, so that we correctly + * handle a request to "reload" after someone changes "smtp" into "25". + * + * We use the external service name from master.cf when reporting problems, so + * that the user can figure out what we are talking about. Of course we also + * include the canonical service name so that the UNIX-domain smtp service + * can be distinguished from the Internet smtp service. */ typedef struct MASTER_SERV { int flags; /* status, features, etc. */ - char *name; /* service endpoint name */ + char *ext_name; /* service endpoint name (master.cf) */ + char *name; /* service endpoint name (canonical) */ int type; /* UNIX-domain, INET, etc. */ + time_t busy_warn_time; /* limit "all servers busy" warning */ int wakeup_time; /* wakeup interval */ int *listen_fd; /* incoming requests */ int listen_fd_count; /* nr of descriptors */ @@ -54,6 +64,7 @@ typedef struct MASTER_SERV { #define MASTER_FLAG_MARK (1<<1) /* garbage collection support */ #define MASTER_FLAG_CONDWAKE (1<<2) /* wake up if actually used */ #define MASTER_FLAG_INETHOST (1<<3) /* endpoint name specifies host */ +#define MASTER_FLAG_LOCAL_ONLY (1<<4) /* no remote clients */ #define MASTER_THROTTLED(f) ((f)->flags & MASTER_FLAG_THROTTLE) diff --git a/postfix/src/master/master_avail.c b/postfix/src/master/master_avail.c index e5507ef6d..496f6078d 100644 --- a/postfix/src/master/master_avail.c +++ b/postfix/src/master/master_avail.c @@ -93,6 +93,7 @@ static void master_avail_event(int event, char *context) void master_avail_listen(MASTER_SERV *serv) { char *myname = "master_avail_listen"; + time_t now; int n; /* @@ -104,14 +105,22 @@ void master_avail_listen(MASTER_SERV *serv) if (msg_verbose) msg_info("%s: avail %d total %d max %d", myname, serv->avail_proc, serv->total_proc, serv->max_proc); - if (serv->avail_proc < 1 - && MASTER_LIMIT_OK(serv->max_proc, serv->total_proc) - && !MASTER_THROTTLED(serv)) { - if (msg_verbose) - msg_info("%s: enable events %s", myname, serv->name); - for (n = 0; n < serv->listen_fd_count; n++) - event_enable_read(serv->listen_fd[n], master_avail_event, - (char *) serv); + if (serv->avail_proc < 1 && !MASTER_THROTTLED(serv)) { + if (MASTER_LIMIT_OK(serv->max_proc, serv->total_proc)) { + if (msg_verbose) + msg_info("%s: enable events %s", myname, serv->name); + for (n = 0; n < serv->listen_fd_count; n++) + event_enable_read(serv->listen_fd[n], master_avail_event, + (char *) serv); + } else if ((serv->flags & MASTER_FLAG_LOCAL_ONLY) == 0 + && (now = event_time()) - serv->busy_warn_time > 1000) { + serv->busy_warn_time = now; + msg_warn("service \"%s\" (%s) has reached its process limit \"%d\": " + "new clients may experience noticeable delays", + serv->ext_name, serv->name, serv->max_proc); + msg_warn("to avoid this condition, increase the process count " + "in master.cf or reduce the service time per client"); + } } } diff --git a/postfix/src/master/master_conf.c b/postfix/src/master/master_conf.c index 2c24cdb9c..55ab4e929 100644 --- a/postfix/src/master/master_conf.c +++ b/postfix/src/master/master_conf.c @@ -131,6 +131,7 @@ void master_config(void) serv->wakeup_time = entry->wakeup_time; serv->max_proc = entry->max_proc; serv->throttle_delay = entry->throttle_delay; + SWAP(char *, serv->ext_name, entry->ext_name); SWAP(char *, serv->path, entry->path); SWAP(ARGV *, serv->args, entry->args); master_restart_service(serv); diff --git a/postfix/src/master/master_ent.c b/postfix/src/master/master_ent.c index 9646b3394..22c1835ce 100644 --- a/postfix/src/master/master_ent.c +++ b/postfix/src/master/master_ent.c @@ -86,6 +86,7 @@ #include#include #include +#include /* Global library. */ @@ -280,9 +281,15 @@ MASTER_SERV *get_master_ent() */ serv->flags = 0; + /* + * All servers busy warning timer. + */ + serv->busy_warn_time = 0; + /* * Service name. Syntax is transport-specific. */ + serv->ext_name = mystrdup(cp); name = cp; /* @@ -294,7 +301,7 @@ MASTER_SERV *get_master_ent() if (STR_SAME(transport, MASTER_XPORT_NAME_INET)) { if (!STR_SAME(saved_interfaces, var_inet_interfaces)) { msg_warn("service %s: ignoring %s change", - name, VAR_INET_INTERFACES); + serv->ext_name, VAR_INET_INTERFACES); msg_warn("to change %s, stop and start Postfix", VAR_INET_INTERFACES); } @@ -323,16 +330,27 @@ MASTER_SERV *get_master_ent() serv->listen_fd_count = MASTER_INET_ADDRLIST(serv)->used; } MASTER_INET_PORT(serv) = mystrdup(port); + for (n = 0; /* see below */ ; n++) { + if (n >= MASTER_INET_ADDRLIST(serv)->used) { + serv->flags |= MASTER_FLAG_LOCAL_ONLY; + break; + } + if (!sock_addr_in_loopback(SOCK_ADDR_PTR(MASTER_INET_ADDRLIST(serv)->addrs + n))) + break; + } } else if (STR_SAME(transport, MASTER_XPORT_NAME_UNIX)) { serv->type = MASTER_SERV_TYPE_UNIX; serv->listen_fd_count = 1; + serv->flags |= MASTER_FLAG_LOCAL_ONLY; } else if (STR_SAME(transport, MASTER_XPORT_NAME_FIFO)) { serv->type = MASTER_SERV_TYPE_FIFO; serv->listen_fd_count = 1; + serv->flags |= MASTER_FLAG_LOCAL_ONLY; #ifdef MASTER_SERV_TYPE_PASS } else if (STR_SAME(transport, MASTER_XPORT_NAME_PASS)) { serv->type = MASTER_SERV_TYPE_PASS; serv->listen_fd_count = 1; + /* If this is a connection screener, remote clients are likely. */ #endif } else { fatal_with_context("bad transport type: %s", transport); @@ -354,7 +372,11 @@ MASTER_SERV *get_master_ent() if (private) fatal_with_context("inet service cannot be private"); -#ifdef SNAPSHOT + + /* + * Canonicalize endpoint names so that we correctly handle "reload" + * requests after someone changes "25" into "smtp" or vice versa. + */ if (*host == 0) host = 0; /* Canonicalize numeric host and numeric or symbolic service. */ @@ -378,7 +400,6 @@ MASTER_SERV *get_master_ent() } /* Bad service name? */ else -#endif serv->name = mystrdup(name); myfree(atmp); } else if (serv->type == MASTER_SERV_TYPE_UNIX) { @@ -552,6 +573,7 @@ void free_master_ent(MASTER_SERV *serv) } if (serv->type == MASTER_SERV_TYPE_INET) myfree(MASTER_INET_PORT(serv)); + myfree(serv->ext_name); myfree(serv->name); myfree(serv->path); argv_free(serv->args); diff --git a/postfix/src/master/master_status.c b/postfix/src/master/master_status.c index 13cd6b9fb..28eb99c19 100644 --- a/postfix/src/master/master_status.c +++ b/postfix/src/master/master_status.c @@ -89,8 +89,8 @@ static void master_status_event(int event, char *context) /* NOTREACHED */ default: - msg_warn("service %s: child (pid %d) sent partial status update (%d bytes)", - serv->name, stat.pid, n); + msg_warn("service %s(%s): child (pid %d) sent partial status update (%d bytes)", + serv->ext_name, serv->name, stat.pid, n); return; case sizeof(stat): diff --git a/postfix/src/master/master_wakeup.c b/postfix/src/master/master_wakeup.c index 7e7328a3f..f04e91dd6 100644 --- a/postfix/src/master/master_wakeup.c +++ b/postfix/src/master/master_wakeup.c @@ -139,7 +139,8 @@ static void master_wakeup_timer_event(int unused_event, char *context) msg_panic("%s: unknown service type: %d", myname, serv->type); } if (status < 0) - msg_warn("%s: service %s: %m", myname, serv->name); + msg_warn("%s: service %s(%s): %m", + myname, serv->ext_name, serv->name); } /* diff --git a/postfix/src/smtp/lmtp_params.c b/postfix/src/smtp/lmtp_params.c index b8d3d4736..efb85e3e6 100644 --- a/postfix/src/smtp/lmtp_params.c +++ b/postfix/src/smtp/lmtp_params.c @@ -43,10 +43,6 @@ VAR_LMTP_STARTTLS_TMOUT, DEF_LMTP_STARTTLS_TMOUT, &var_smtp_starttls_tmout, 1, 0, #endif VAR_SCACHE_PROTO_TMOUT, DEF_SCACHE_PROTO_TMOUT, &var_scache_proto_tmout, 1, 0, - VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 1, 0, - VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 1, 0, - VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 0, 0, - VAR_LMTP_DOTQ_THRESH, DEF_LMTP_DOTQ_THRESH, &var_smtp_dotq_thresh, 0, 0, 0, }; static CONFIG_INT_TABLE lmtp_int_table[] = { diff --git a/postfix/src/smtp/smtp.c b/postfix/src/smtp/smtp.c index 00b3cae5c..cc1199d4a 100644 --- a/postfix/src/smtp/smtp.c +++ b/postfix/src/smtp/smtp.c @@ -140,11 +140,6 @@ /* Never send EHLO at the start of an SMTP session. /* .IP "\fBsmtp_defer_if_no_mx_address_found (no)\fR" /* Defer mail delivery when no MX record resolves to an IP address. -/* .IP "\fBsmtp_dot_quit_workaround_threshold_time (3000s)\fR" -/* How long a message must be queued before the "." + QUIT bug -/* workaround is turned on for all deliveries; this limits the -/* number of repeated deliveries with servers or firewalls that -/* mis-implement END-OF-DATA + QUIT pipelining. /* .IP "\fBsmtp_line_length_limit (990)\fR" /* The maximal length of message header and body lines that Postfix /* will send via SMTP. @@ -622,12 +617,6 @@ char *var_prop_extension; bool var_smtp_sender_auth; char *var_lmtp_tcp_port; int var_scache_proto_tmout; -int var_smtp_dotq_thresh; - -/* Workaround for "smtp_dot_quit_workaround_threshold_time = $name". */ -int var_min_backoff_time; -int var_max_backoff_time; -int var_max_queue_time; /* * Global variables. smtp_errno is set by the address lookup routines and by diff --git a/postfix/src/smtp/smtp_chat.c b/postfix/src/smtp/smtp_chat.c index 753061996..0b645dc47 100644 --- a/postfix/src/smtp/smtp_chat.c +++ b/postfix/src/smtp/smtp_chat.c @@ -144,7 +144,6 @@ void smtp_chat_init(SMTP_SESSION *session) void smtp_chat_reset(SMTP_SESSION *session) { - if (session->history) { argv_free(session->history); session->history = 0; @@ -277,23 +276,44 @@ SMTP_RESP *smtp_chat_resp(SMTP_SESSION *session) } /* - * XXX Do not ignore garbage when ESMTP command pipelining is turned - * on. After sending ". QUIT ", Postfix might recognize - * the server's 2XX QUIT reply as a 2XX END-OF-DATA reply after - * garbage, causing mail to be lost. Instead, make a long jump so - * that all recipients of multi-recipient mail get consistent - * treatment. + * XXX Do not simply ignore garbage in the server reply when ESMTP + * command pipelining is turned on. For example, after sending + * ". QUIT " and receiving garbage followed by a + * legitimate 2XX reply, Postfix recognizes the server's QUIT reply + * as the END-OF-DATA reply after garbage, causing mail to be lost. + * + * Without the ability to store per-domain status information in queue + * files, automatic workarounds are problematic: + * + * - Automatically deferring delivery creates a "repeated delivery" + * problem when garbage arrives after the DATA stage. Without the + * workaround, Postfix delivers only once. + * + * - Automatically deferring delivery creates a "no delivery" problem + * when the garbage arrives before the DATA stage. Without the + * workaround, mail might still get through. + * + * - Automatically turning off pipelining for delayed mail affects + * deliveries to correctly implemented servers, and may also affect + * delivery of large mailing lists. + * + * So we leave the decision with the administrator, but we don't force + * them to take action, like we would with automatic deferral. If + * loss of mail is not acceptable then they can turn off pipelining + * for specific sites, or they can turn off pipelining globally when + * they find that there are just too many broken sites. */ session->error_mask |= MAIL_ERROR_PROTOCOL; if (session->features & SMTP_FEATURE_PIPELINING) { - msg_warn("non-%s response from %s: %s", - (session->state->misc_flags & - SMTP_MISC_FLAG_USE_LMTP) ? "LMTP" : "ESMTP", - session->namaddrport, STR(session->buffer)); - msg_warn("consider turning off pipelining selectively with %s", + msg_warn("non-%s response from %s: %.100s", (session->state->misc_flags & SMTP_MISC_FLAG_USE_LMTP) ? - VAR_LMTP_EHLO_DIS_WORDS : VAR_SMTP_EHLO_DIS_MAPS); - vstream_longjmp(session->stream, SMTP_ERR_PROTO); + "LMTP" : "ESMTP", session->namaddrport, + STR(session->buffer)); + if (var_helpful_warnings) + msg_warn("to prevent loss of mail, turn off command pipelining " + "for %s with the %s parameter", session->addr, + (session->state->misc_flags & SMTP_MISC_FLAG_USE_LMTP) ? + VAR_LMTP_EHLO_DIS_MAPS : VAR_SMTP_EHLO_DIS_MAPS); } } diff --git a/postfix/src/smtp/smtp_params.c b/postfix/src/smtp/smtp_params.c index 92317722c..f3a1494b1 100644 --- a/postfix/src/smtp/smtp_params.c +++ b/postfix/src/smtp/smtp_params.c @@ -44,10 +44,6 @@ VAR_SMTP_STARTTLS_TMOUT, DEF_SMTP_STARTTLS_TMOUT, &var_smtp_starttls_tmout, 1, 0, #endif VAR_SCACHE_PROTO_TMOUT, DEF_SCACHE_PROTO_TMOUT, &var_scache_proto_tmout, 1, 0, - VAR_MIN_BACKOFF_TIME, DEF_MIN_BACKOFF_TIME, &var_min_backoff_time, 1, 0, - VAR_MAX_BACKOFF_TIME, DEF_MAX_BACKOFF_TIME, &var_max_backoff_time, 1, 0, - VAR_MAX_QUEUE_TIME, DEF_MAX_QUEUE_TIME, &var_max_queue_time, 0, 0, - VAR_SMTP_DOTQ_THRESH, DEF_SMTP_DOTQ_THRESH, &var_smtp_dotq_thresh, 0, 0, 0, }; static CONFIG_INT_TABLE smtp_int_table[] = { diff --git a/postfix/src/smtp/smtp_proto.c b/postfix/src/smtp/smtp_proto.c index 1a3041c42..337fda0a0 100644 --- a/postfix/src/smtp/smtp_proto.c +++ b/postfix/src/smtp/smtp_proto.c @@ -927,10 +927,7 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state, (recv_state < send_state || recv_rcpt != send_rcpt) #define SENDER_IN_WAIT_STATE \ - (send_state == SMTP_STATE_DOT || send_state == SMTP_STATE_LAST \ - || (recv_state == SMTP_STATE_DOT && send_state == SMTP_STATE_QUIT \ - && request->msg_stats.incoming_arrival.tv_sec \ - <= vstream_ftime(session->stream) - var_smtp_dotq_thresh)) + (send_state == SMTP_STATE_DOT || send_state == SMTP_STATE_LAST) #define SENDING_MAIL \ (recv_state <= SMTP_STATE_DOT)