From b9cbb4a6b73f6e19f77871613e7e2cc3f125513e Mon Sep 17 00:00:00 2001
From: Wietse Venema
Date: Sat, 10 Jan 2009 00:00:00 -0500
Subject: [PATCH] postfix-2.6-20090110
---
postfix/.indent.pro | 5 +-
postfix/HISTORY | 32 ++++--
postfix/RELEASE_NOTES | 28 ++++-
postfix/WISHLIST | 31 ++---
postfix/conf/access | 168 ++++++++++++++--------------
postfix/html/NFS_README.html | 2 +-
postfix/html/access.5.html | 166 ++++++++++++++-------------
postfix/html/postconf.5.html | 34 +++++-
postfix/html/smtp-sink.1.html | 5 +
postfix/html/smtp-source.1.html | 5 +
postfix/man/man1/smtp-sink.1 | 4 +
postfix/man/man1/smtp-source.1 | 4 +
postfix/man/man5/access.5 | 6 +
postfix/man/man5/postconf.5 | 42 ++++++-
postfix/proto/NFS_README.html | 2 +-
postfix/proto/postconf.proto | 37 +++++-
postfix/src/global/Makefile.in | 17 ++-
postfix/src/global/mail_params.c | 3 +-
postfix/src/global/mail_version.h | 2 +-
postfix/src/global/match_service.c | 139 +++++++++++++++++++++++
postfix/src/global/match_service.h | 31 +++++
postfix/src/master/Makefile.in | 13 ++-
postfix/src/master/master.h | 29 +++++
postfix/src/master/master_ent.c | 10 +-
postfix/src/master/master_vars.c | 113 +------------------
postfix/src/master/master_watch.c | 151 +++++++++++++++++++++++++
postfix/src/smtp/smtp_connect.c | 3 +
postfix/src/smtpstone/smtp-sink.c | 10 +-
postfix/src/smtpstone/smtp-source.c | 12 +-
postfix/src/util/Makefile.in | 8 +-
postfix/src/util/connect.h | 2 -
postfix/src/util/inet_connect.c | 12 +-
postfix/src/util/inet_listen.c | 18 +--
postfix/src/util/inet_windowsize.c | 79 +++++++++++++
postfix/src/util/iostuff.h | 3 +
postfix/src/util/listen.h | 2 -
36 files changed, 861 insertions(+), 367 deletions(-)
create mode 100644 postfix/src/global/match_service.c
create mode 100644 postfix/src/global/match_service.h
create mode 100644 postfix/src/master/master_watch.c
create mode 100644 postfix/src/util/inet_windowsize.c
diff --git a/postfix/.indent.pro b/postfix/.indent.pro
index 8d572dec4..3c96b8041 100644
--- a/postfix/.indent.pro
+++ b/postfix/.indent.pro
@@ -137,11 +137,12 @@
-TMAI_SERVNAME_STR
-TMAI_SERVPORT_STR
-TMAPS
+-TMASTER_INT_WATCH
-TMASTER_PROC
-TMASTER_SERV
-TMASTER_STATUS
--TMASTER_VARS_STR_WATCH
--TMASTER_VARS_INT_WATCH
+-TMASTER_STR_WATCH
+-TMATCH_LIST
-TMBLOCK
-TMBOX
-TMILTER
diff --git a/postfix/HISTORY b/postfix/HISTORY
index ffda0a389..c920cef9c 100644
--- a/postfix/HISTORY
+++ b/postfix/HISTORY
@@ -14845,10 +14845,12 @@ Apologies for any names omitted.
and type. For example, to turn off the main SMTP listener
use "master_service_disable = smtp.inet", and to turn off
all TCP/IP listeners use "master_service_disable = inet".
- This feature does not distinguish services by their privacy
- property; some day, clients will not need to specify that
- anymore. Files: global/mail_params.h, master/master.c,
- master/master_vars.c, master/master_ent.c.
+ This immediately terminates all processes that provide the
+ specified services. The master_service_disable feature does
+ not distinguish services by their privacy property; some
+ day, clients will not need to specify that anymore. Files:
+ global/mail_params.h, master/master.c, master/master_vars.c,
+ master/master_ent.c.
Bugfix (introduced May 19, 1997): removing a parameter
setting from main.cf did not reset the parameter to its
@@ -14863,8 +14865,20 @@ Apologies for any names omitted.
smtpd/smtpd_check.c, proto/access.
Workaround: specify "tcp_windowsize = 65535" (or less) to
- work around routers with broken TCP window scaling
- implementations. This is perhaps easier than collecting
- tcpdump output and tuning kernel parameters. Changing this
- parameter requires "postfix stop" and "postfix start".
- Files: util/inet_connect.c, inet_listen.c, global/mail_params.[hc].
+ work around broken TCP window scaling implementations. This
+ is perhaps easier than collecting tcpdump output and tuning
+ kernel parameters by hand. See RELEASE_NOTES for how to
+ change this setting without stopping Postfix. Files:
+ util/inet_connect.c, inet_listen.c, global/mail_params.[hc].
+
+20090110
+
+ Cleanup: create separate code modules for TCP window size
+ handling, master.cf service name matching, and main.cf
+ change monitoring. Files: util/inet_windowsize.c,
+ global/match_service.c, master/master_watch.c.
+
+ Feature: TCP window size override for the Postfix SMTP/LMTP
+ client, and for the smtp-source and smtp-sink test programs.
+ Files: smtp/smtp_connect.c, smtpstone/smtp-source.c,
+ smtpstone/smtp-sink.c.
diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES
index e4073049d..ee740f947 100644
--- a/postfix/RELEASE_NOTES
+++ b/postfix/RELEASE_NOTES
@@ -20,12 +20,34 @@ type or by service name + type. Specify a list of service types
"name" is the first field of a master.cf entry and "type" is a
service type. Examples: to turn off the main SMTP listener port,
use "master_service_disable = smtp.inet"; to turn off all TCP/IP
-listeners, use "master_service_disable = inet".
+listeners, use "master_service_disable = inet". Changing this
+parameter requires "postfix reload".
Specify "tcp_windowsize = 65535" (or less) to work around routers
with broken TCP window scaling implementations. This is perhaps
-easier than collecting tcpdump output and tuning kernel parameters.
-Changing this parameter requires "postfix stop" and "postfix start".
+more convenient than collecting tcpdump output and tuning kernel
+parameters by hand. With Postfix TCP servers (smtpd(8), qmqpd(8)),
+this feature is implemented by the Postfix master(8) daemon.
+
+To change this parameter without stopping Postfix, you need to first
+terminate all Postfix TCP servers:
+
+ # postconf -e master_service_disable=inet
+ # postfix reload
+
+This immediately terminates all processes that accept network
+connections. Then you enable Postfix TCP servers with the updated
+tcp_windowsize setting:
+
+ # postconf -e tcp_windowsize=65535 master_service_disable=
+ # postfix reload
+
+If you skip these steps with a running Postfix system, then the
+tcp_windowsize change will work only for Postfix TCP clients (smtp(8),
+lmtp(8)).
+
+Of course you can also do "postfix stop" and "postfix start",
+but that is more disruptive.
Major changes with snapshot 20081010
====================================
diff --git a/postfix/WISHLIST b/postfix/WISHLIST
index 7c4519c66..466046f15 100644
--- a/postfix/WISHLIST
+++ b/postfix/WISHLIST
@@ -1,11 +1,4 @@
Wish list:
-
- To work around window scaling bugs, find out if we can force
- < 65535 TCP windows with setsockopt(SO_SNDBUF/SO_RCVBUF)
- between socket() and connect()/listen(). Instead of screwing
- up lots of internal APIs with an extra buffer size parameter,
- use a -o command-line option to override a global variable
- for use by inet_connect() and inet_listen().
Force a panic when the VDA patch reduces the file size limit
under the message size. They break the code that marks a
@@ -21,6 +14,9 @@ Wish list:
Encapsulate time_t conversions (e.g. REC_TYPE_TIME) so that
they can be made system dependent.
+ Plan for time_t larger than long, or wait for LP64 to
+ dominate the world?
+
Make "AUTH=<>" appendage to MAIL FROM configurable, enabled
by default.
@@ -45,11 +41,11 @@ Wish list:
and remote mail; the disadvantage is that it makes local
submissions more dependent on networking. One possibility
is to use "pickup -o content_filter=smtp:127.0.0.1:10025";
- we could also to suppress "mail loop" detection for loopback
- connections. Another is to have the pickup or cleanup
- server drive an SMTP client directly; this would require
- extension of the mail_stream() interface, plus a way to
- handle bounced/deferred recipients intelligently.
+ we could also decide to always suppress "mail loop" detection
+ for loopback connections. Another option is to have the
+ pickup or cleanup server drive an SMTP client directly;
+ this would require extension of the mail_stream() interface,
+ plus a way to handle bounced/deferred recipients intelligently.
Consolidate duplicated code in *_server_accept_{pass,inet}().
@@ -75,14 +71,6 @@ Wish list:
Make TLS_BIO_BUFSIZE run-time adjustable, to future-proof
Postfix for remote connections with MSS > 8 kbytes.
- Absent a formal spec, model IPv6 RBL lookups after the IPv6
- PTR lookups (one zone per hex nibble, nibbles in reversed
- order). How to specify whether to query an RBL server for
- status info about an IPv6 address? One could argue that as
- long as IPv6 traffic is small an unsupported lookup doesn't
- matter; and once IPv6 takes off, the RBL servers better
- start supporting IPv6 client status information.
-
Don't log "warning: XXXXX: undeliverable postmaster
notification discarded" for spam from outside.
@@ -149,9 +137,6 @@ Wish list:
into mailer-daemon (current bahavior) or disallow (strict
behavior, currently implemented only in the SMTP server).
- Plan for time_t larger than long, or wait for LP64 to
- dominate the world?
-
The type of var_message_limit (and other file size/offset
configuration parameters or internal protocol attributes)
should be changed from int to off_t. This also requires
diff --git a/postfix/conf/access b/postfix/conf/access
index 2aa8f6450..00aa6cd19 100644
--- a/postfix/conf/access
+++ b/postfix/conf/access
@@ -202,22 +202,28 @@
# text..." when the optional text is specified, oth-
# erwise reply with a generic error response message.
#
+# This feature is available in Postfix 2.6 and later.
+#
# DEFER_IF_REJECT optional text...
-# Defer the request if some later restriction would
-# result in a REJECT action. Reply with
-# "$access_map_defer_code 4.7.1 optional text..."
-# when the optional text is specified, otherwise
+# Defer the request if some later restriction would
+# result in a REJECT action. Reply with
+# "$access_map_defer_code 4.7.1 optional text..."
+# when the optional text is specified, otherwise
# reply with a generic error response message.
#
+# Prior to Postfix 2.6, the SMTP reply code is 450.
+#
# This feature is available in Postfix 2.1 and later.
#
# DEFER_IF_PERMIT optional text...
-# Defer the request if some later restriction would
-# result in a an explicit or implicit PERMIT action.
-# Reply with "$access_map_defer_code 4.7.1 optional
-# text..." when the optional text is specified, oth-
+# Defer the request if some later restriction would
+# result in a an explicit or implicit PERMIT action.
+# Reply with "$access_map_defer_code 4.7.1 optional
+# text..." when the optional text is specified, oth-
# erwise reply with a generic error response message.
#
+# Prior to Postfix 2.6, the SMTP reply code is 450.
+#
# This feature is available in Postfix 2.1 and later.
#
# OTHER ACTIONS
@@ -226,169 +232,169 @@
# reject_unauth_destination, and so on).
#
# BCC user@domain
-# Send one copy of the message to the specified
+# Send one copy of the message to the specified
# recipient.
#
-# If multiple BCC actions are specified within the
-# same SMTP MAIL transaction, only the last action
+# If multiple BCC actions are specified within the
+# same SMTP MAIL transaction, only the last action
# will be used.
#
-# This feature is not part of the stable Postfix
+# This feature is not part of the stable Postfix
# release.
#
# DISCARD optional text...
-# Claim successful delivery and silently discard the
-# message. Log the optional text if specified, oth-
+# Claim successful delivery and silently discard the
+# message. Log the optional text if specified, oth-
# erwise log a generic message.
#
-# Note: this action currently affects all recipients
-# of the message. To discard only one recipient
-# without discarding the entire message, use the
+# Note: this action currently affects all recipients
+# of the message. To discard only one recipient
+# without discarding the entire message, use the
# transport(5) table to direct mail to the discard(8)
# service.
#
# This feature is available in Postfix 2.0 and later.
#
-# DUNNO Pretend that the lookup key was not found. This
-# prevents Postfix from trying substrings of the
-# lookup key (such as a subdomain name, or a network
+# DUNNO Pretend that the lookup key was not found. This
+# prevents Postfix from trying substrings of the
+# lookup key (such as a subdomain name, or a network
# address subnetwork).
#
# This feature is available in Postfix 2.0 and later.
#
# FILTER transport:destination
-# After the message is queued, send the entire mes-
+# After the message is queued, send the entire mes-
# sage through the specified external content filter.
-# The transport:destination syntax is described in
-# the transport(5) manual page. More information
-# about external content filters is in the Postfix
+# The transport:destination syntax is described in
+# the transport(5) manual page. More information
+# about external content filters is in the Postfix
# FILTER_README file.
#
# Note: this action overrides the content_filter set-
-# ting, and currently affects all recipients of the
+# ting, and currently affects all recipients of the
# message.
#
# This feature is available in Postfix 2.0 and later.
#
# HOLD optional text...
-# Place the message on the hold queue, where it will
-# sit until someone either deletes it or releases it
-# for delivery. Log the optional text if specified,
+# Place the message on the hold queue, where it will
+# sit until someone either deletes it or releases it
+# for delivery. Log the optional text if specified,
# otherwise log a generic message.
#
-# Mail that is placed on hold can be examined with
-# the postcat(1) command, and can be destroyed or
+# Mail that is placed on hold can be examined with
+# the postcat(1) command, and can be destroyed or
# released with the postsuper(1) command.
#
-# Note: use "postsuper -r" to release mail that was
-# kept on hold for a significant fraction of $maxi-
+# Note: use "postsuper -r" to release mail that was
+# kept on hold for a significant fraction of $maxi-
# mal_queue_lifetime or $bounce_queue_lifetime, or
-# longer. Use "postsuper -H" only for mail that will
+# longer. Use "postsuper -H" only for mail that will
# not expire within a few delivery attempts.
#
-# Note: this action currently affects all recipients
+# Note: this action currently affects all recipients
# of the message.
#
# This feature is available in Postfix 2.0 and later.
#
# PREPEND headername: headervalue
-# Prepend the specified message header to the mes-
-# sage. When more than one PREPEND action executes,
-# the first prepended header appears before the sec-
+# Prepend the specified message header to the mes-
+# sage. When more than one PREPEND action executes,
+# the first prepended header appears before the sec-
# ond etc. prepended header.
#
-# Note: this action must execute before the message
-# content is received; it cannot execute in the con-
+# Note: this action must execute before the message
+# content is received; it cannot execute in the con-
# text of smtpd_end_of_data_restrictions.
#
# This feature is available in Postfix 2.1 and later.
#
# REDIRECT user@domain
-# After the message is queued, send the message to
+# After the message is queued, send the message to
# the specified address instead of the intended
# recipient(s).
#
-# Note: this action overrides the FILTER action, and
+# Note: this action overrides the FILTER action, and
# currently affects all recipients of the message.
#
# This feature is available in Postfix 2.1 and later.
#
# WARN optional text...
# Log a warning with the optional text, together with
-# client information and if available, with helo,
+# client information and if available, with helo,
# sender, recipient and protocol information.
#
# This feature is available in Postfix 2.1 and later.
#
# ENHANCED STATUS CODES
-# Postfix version 2.3 and later support enhanced status
-# codes as defined in RFC 3463. When an enhanced status
-# code is specified in an access table, it is subject to
-# modification. The following transformations are needed
-# when the same access table is used for client, helo,
-# sender, or recipient access restrictions; they happen
+# Postfix version 2.3 and later support enhanced status
+# codes as defined in RFC 3463. When an enhanced status
+# code is specified in an access table, it is subject to
+# modification. The following transformations are needed
+# when the same access table is used for client, helo,
+# sender, or recipient access restrictions; they happen
# regardless of whether Postfix replies to a MAIL FROM, RCPT
# TO or other SMTP command.
#
-# o When a sender address matches a REJECT action, the
-# Postfix SMTP server will transform a recipient DSN
-# status (e.g., 4.1.1-4.1.6) into the corresponding
+# o When a sender address matches a REJECT action, the
+# Postfix SMTP server will transform a recipient DSN
+# status (e.g., 4.1.1-4.1.6) into the corresponding
# sender DSN status, and vice versa.
#
-# o When non-address information matches a REJECT
-# action (such as the HELO command argument or the
-# client hostname/address), the Postfix SMTP server
-# will transform a sender or recipient DSN status
-# into a generic non-address DSN status (e.g.,
+# o When non-address information matches a REJECT
+# action (such as the HELO command argument or the
+# client hostname/address), the Postfix SMTP server
+# will transform a sender or recipient DSN status
+# into a generic non-address DSN status (e.g.,
# 4.0.0).
#
# REGULAR EXPRESSION TABLES
-# This section describes how the table lookups change when
+# This section describes how the table lookups change when
# the table is given in the form of regular expressions. For
-# a description of regular expression lookup table syntax,
+# a description of regular expression lookup table syntax,
# see regexp_table(5) or pcre_table(5).
#
-# Each pattern is a regular expression that is applied to
+# Each pattern is a regular expression that is applied to
# the entire string being looked up. Depending on the appli-
-# cation, that string is an entire client hostname, an
+# cation, that string is an entire client hostname, an
# entire client IP address, or an entire mail address. Thus,
# no parent domain or parent network search is done,
-# user@domain mail addresses are not broken up into their
+# user@domain mail addresses are not broken up into their
# user@ and domain constituent parts, nor is user+foo broken
# up into user and foo.
#
-# Patterns are applied in the order as specified in the ta-
-# ble, until a pattern is found that matches the search
+# Patterns are applied in the order as specified in the ta-
+# ble, until a pattern is found that matches the search
# string.
#
-# Actions are the same as with indexed file lookups, with
-# the additional feature that parenthesized substrings from
+# Actions are the same as with indexed file lookups, with
+# the additional feature that parenthesized substrings from
# the pattern can be interpolated as $1, $2 and so on.
#
# TCP-BASED TABLES
-# This section describes how the table lookups change when
+# This section describes how the table lookups change when
# lookups are directed to a TCP-based server. For a descrip-
# tion of the TCP client/server lookup protocol, see tcp_ta-
# ble(5). This feature is not available up to and including
# Postfix version 2.4.
#
-# Each lookup operation uses the entire query string once.
-# Depending on the application, that string is an entire
+# Each lookup operation uses the entire query string once.
+# Depending on the application, that string is an entire
# client hostname, an entire client IP address, or an entire
-# mail address. Thus, no parent domain or parent network
-# search is done, user@domain mail addresses are not broken
-# up into their user@ and domain constituent parts, nor is
+# mail address. Thus, no parent domain or parent network
+# search is done, user@domain mail addresses are not broken
+# up into their user@ and domain constituent parts, nor is
# user+foo broken up into user and foo.
#
# Actions are the same as with indexed file lookups.
#
# EXAMPLE
-# The following example uses an indexed file, so that the
-# order of table entries does not matter. The example per-
-# mits access by the client at address 1.2.3.4 but rejects
-# all other clients in 1.2.3.0/24. Instead of hash lookup
-# tables, some systems use dbm. Use the command "postconf
-# -m" to find out what lookup tables Postfix supports on
+# The following example uses an indexed file, so that the
+# order of table entries does not matter. The example per-
+# mits access by the client at address 1.2.3.4 but rejects
+# all other clients in 1.2.3.0/24. Instead of hash lookup
+# tables, some systems use dbm. Use the command "postconf
+# -m" to find out what lookup tables Postfix supports on
# your system.
#
# /etc/postfix/main.cf:
@@ -399,11 +405,11 @@
# 1.2.3 REJECT
# 1.2.3.4 OK
#
-# Execute the command "postmap /etc/postfix/access" after
+# Execute the command "postmap /etc/postfix/access" after
# editing the file.
#
# BUGS
-# The table format does not understand quoting conventions.
+# The table format does not understand quoting conventions.
#
# SEE ALSO
# postmap(1), Postfix lookup table manager
@@ -412,13 +418,13 @@
# transport(5), transport:nexthop syntax
#
# README FILES
-# Use "postconf readme_directory" or "postconf html_direc-
+# Use "postconf readme_directory" or "postconf html_direc-
# tory" to locate this information.
# SMTPD_ACCESS_README, built-in SMTP server access control
# DATABASE_README, Postfix lookup table overview
#
# 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/html/NFS_README.html b/postfix/html/NFS_README.html
index 1661541fc..fdbd0fdc5 100644
--- a/postfix/html/NFS_README.html
+++ b/postfix/html/NFS_README.html
@@ -56,7 +56,6 @@ methods simultaneously.
mailbox_delivery_lock = fcntl, dotlock
-