diff --git a/postfix/COMPATIBILITY b/postfix/COMPATIBILITY index e9a27b111..494efe453 100644 --- a/postfix/COMPATIBILITY +++ b/postfix/COMPATIBILITY @@ -3,6 +3,7 @@ /usr/spool/mail yes (compile time option) /var/mail yes (compile time option) /var/spool/mail yes (compile time option) +8bitmime yes (including 8bit to quoted-printable conversion) :include: yes (mail to /file and |command is off by default) aliases yes (can enable/disable mail to /file or |command) bare newlines yes (but will send CRLF) @@ -14,7 +15,7 @@ delivered-to yes (configurable with prepend_delivered_header) dsn not yet (bounces have DSN form) errors-to: yes esmtp yes -etrn support yes (uses per-destination log or flushes entire queue) +etrn support yes (per-destination log for authorized destinations only) fcntl locking yes (runtime configurable) flock locking yes (runtime configurable) home mailbox yes @@ -28,7 +29,8 @@ mail to file yes (configurable for .forward, aliases, :include:) maildir yes (in home, system mailspool, /file/name/ alias) mailertable yes (it's called transport) mailq yes -majordomo yes (edit approve script to delete /delivered-to/i) +majordomo yes (edit approve script to delete /^delivered-to:/i) +mime yes (including 8bit to quoted-printable conversion) mime conversion not yet; postfix uses just-send-eight mysql tables yes (contributed) netinfo tables yes (contributed) diff --git a/postfix/HISTORY b/postfix/HISTORY index 4a33442ff..9d8a06eba 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -6592,6 +6592,23 @@ Apologies for any names omitted. Patch by Sebastian Schaffert @ wastl.net. File: global/deliver_pass.c. +20020604 + + Workaround: Solaris non-blocking read() can fail on a socket + with unread data according to ioctl FIONREAD. Incredible. + Diagnosis by Max Pashkov. File: smtp/smtp-sink.c. + + Weirdstuff: sender-based routing. This will become more + useful once per-address transport map entries are done. + File: src/qmgr/qmgr_message.c. + +20020605 + + Safety: header_address_token_limit limits the amount of + memory and CPU that we're willing to spend while parsing + addresses in message headers. The limit is expressed as a + number of tokens. File: global/tok822_parse.c + Open problems: Medium: old maildrop files are no longer readable by the diff --git a/postfix/INSTALL b/postfix/INSTALL index b0e551e2a..05f45601f 100644 --- a/postfix/INSTALL +++ b/postfix/INSTALL @@ -474,7 +474,7 @@ the Postfix queue directories (/var/spool/postfix). This provides a significant barrier against intrusion. The barrier is not impenetrable, but every little bit helps. -With the exception of the Postfix local delivery and `pipe' daemons, +With the exception of the Postfix daemons that deliver mail locally, every Postfix daemon can run chrooted. Sites with high security requirements should consider to chroot diff --git a/postfix/README_FILES/FILTER_README b/postfix/README_FILES/FILTER_README index d2c598cdc..3a8de5787 100644 --- a/postfix/README_FILES/FILTER_README +++ b/postfix/README_FILES/FILTER_README @@ -372,7 +372,7 @@ localhost:10026 inet n - n - - smtpd -o local_recipient_maps= -o virtual_maps= -o virtual_mailbox_maps= - -o cleanup_service=cleanup2 + -o cleanup_service_name=cleanup2 -o mynetworks=127.0.0.0/8 -o mynetworks_style=host -o smtpd_restriction_classes= diff --git a/postfix/conf/master.cf b/postfix/conf/master.cf index 2e5068f11..d7ae64c33 100644 --- a/postfix/conf/master.cf +++ b/postfix/conf/master.cf @@ -19,7 +19,8 @@ # # Unprivileged: whether the service runs with root privileges or as # the owner of the Postfix system (the owner name is controlled by the -# mail_owner configuration variable in the main.cf file). +# mail_owner configuration variable in the main.cf file). Only the +# pipe, virtual and local delivery daemons require privileges. # # Chroot: whether or not the service runs chrooted to the mail queue # directory (pathname is controlled by the queue_directory configuration @@ -87,10 +88,12 @@ lmtp unix - - n - - lmtp # # Interfaces to non-Postfix software. Be sure to examine the manual # pages of the non-Postfix software to find out what options it wants. -# The Cyrus deliver program has changed incompatibly. +# The Cyrus deliver program has changed incompatibly, multiple times. # -cyrus unix - n n - - pipe +old-cyrus unix - n n - - pipe flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user} +cyrus unix - n n - - pipe + user=cyrus argv=/cyrus/bin/deliver -e -r ${recipient} -m ${extension} ${user} uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) ifmail unix - n n - - pipe diff --git a/postfix/conf/pcre_table b/postfix/conf/pcre_table index fd020255f..6039eadee 100644 --- a/postfix/conf/pcre_table +++ b/postfix/conf/pcre_table @@ -47,21 +47,21 @@ # matching is case insensitive. # # m (default: off) -# Toggles the PCRE_MULTILINE flag. When the flag is +# Toggles the PCRE_MULTILINE flag. When this flag is # on, the ^ and $ metacharacters match immediately # after and immediately before a newline character, # respectively, in addition to matching at the start # and end of the subject string. # # s (default: on) -# Toggle the PCRE_DOTALL flag. When the flag is on, +# Toggles the PCRE_DOTALL flag. When this flag is on, # the . metacharacter matches the newline character. # With Postfix versions prior to 20020528, The flag # is off by default, which is inconvenient for multi- # line message header matching. # # x (default: off) -# Toggles the pcre extended flag. When the flag is +# Toggles the pcre extended flag. When this flag is # on, whitespace in the pattern (other than in a # character class) and characters between a # outside # a character class and the next newline character @@ -71,7 +71,7 @@ # # A (default: off) # Toggles the PCRE_ANCHORED flag. When this flag is -# set, the pattern is forced to be "anchored", that +# on, the pattern is forced to be "anchored", that # is, it is constrained to match only at the start of # the string which is being searched (the "subject # string"). This effect can also be achieved by @@ -79,7 +79,7 @@ # # E (default: off) # Toggles the PCRE_DOLLAR_ENDONLY flag. When this -# flag is set, a $ metacharacter in the pattern +# flag is on, a $ metacharacter in the pattern # matches only at the end of the subject string. # Without this flag, a dollar also matches immedi- # ately before the final character if it is a newline @@ -89,18 +89,18 @@ # # U (default: off) # Toggles the ungreedy matching flag. When this flag -# is set, the pattern matching engine inverts the +# is on, the pattern matching engine inverts the # "greediness" of the quantifiers so that they are # not greedy by default, but become greedy if fol- # lowed by "?". This flag can also set by a (?U) # modifier within the pattern. # # X (default: off) -# Toggles the PCRE_EXTRA flag. When this flag is -# set, any backslash in a pattern that is followed by -# a letter that has no special meaning causes an -# error, thus reserving these combinations for future -# expansion. +# Toggles the PCRE_EXTRA flag. When this flag is on, +# any backslash in a pattern that is followed by a +# letter that has no special meaning causes an error, +# thus reserving these combinations for future expan- +# sion. # # Each pattern is applied to the entire lookup key string. # Depending on the application, that string is an entire diff --git a/postfix/conf/sample-resource.cf b/postfix/conf/sample-resource.cf index 13c7211b5..c6cdbc32f 100644 --- a/postfix/conf/sample-resource.cf +++ b/postfix/conf/sample-resource.cf @@ -61,11 +61,18 @@ fork_attempts = 5 fork_delay = 1s # The header_size_limit parameter limits the amount of memory in -# bytes used for processing a message header. If a header is larger, -# the remainder of the entire message is treated as message body. +# bytes used for storing a message header. If a header is larger, +# the remainder of the header is descarded. # header_size_limit = 102400 +# The header_address_token_limit limits the amount of memory and CPU +# that Postfix will spend while rewriting addresses in message headers. +# The limit is expressed as a token count. Tokens beyond the limit are +# discarded. +# +header_address_token_limit = 10240 + # The line_length_limit parameter limits the amount of memory in # bytes used for handling input lines. Longer lines are chopped up # into pieces and reconstructed upon delivery. diff --git a/postfix/conf/sample-smtpd.cf b/postfix/conf/sample-smtpd.cf index cb36e4dc7..87273646e 100644 --- a/postfix/conf/sample-smtpd.cf +++ b/postfix/conf/sample-smtpd.cf @@ -125,7 +125,7 @@ strict_rfc821_envelopes = no # response. This prevents naive clients from going into an error - # disconnect - connect - error loop. # -smtpd_error_sleep_time = 5 +smtpd_error_sleep_time = 1s # The smtpd_soft_error_limit parameter specifies an error count lower # limit. When an SMTP client has made this number of errors within @@ -138,7 +138,7 @@ smtpd_soft_error_limit = 10 # limit. The SMTP server disconnects after an SMTP client makes this # number of errors within a session. # -smtpd_hard_error_limit = 100 +smtpd_hard_error_limit = 20 # # UCE RESTRICTIONS diff --git a/postfix/html/pcre_table.5.html b/postfix/html/pcre_table.5.html index bdf83fb85..b03d47107 100644 --- a/postfix/html/pcre_table.5.html +++ b/postfix/html/pcre_table.5.html @@ -48,21 +48,21 @@ PCRE_TABLE(5) PCRE_TABLE(5) matching is case insensitive. m (default: off) - Toggles the PCRE_MULTILINE flag. When the flag is + Toggles the PCRE_MULTILINE flag. When this flag is on, the ^ and $ metacharacters match immediately after and immediately before a newline character, respectively, in addition to matching at the start and end of the subject string. s (default: on) - Toggle the PCRE_DOTALL flag. When the flag is on, + Toggles the PCRE_DOTALL flag. When this flag is on, the . metacharacter matches the newline character. With Postfix versions prior to 20020528, The flag is off by default, which is inconvenient for multi- line message header matching. x (default: off) - Toggles the pcre extended flag. When the flag is + Toggles the pcre extended flag. When this flag is on, whitespace in the pattern (other than in a character class) and characters between a # outside a character class and the next newline character @@ -72,7 +72,7 @@ PCRE_TABLE(5) PCRE_TABLE(5) A (default: off) Toggles the PCRE_ANCHORED flag. When this flag is - set, the pattern is forced to be "anchored", that + on, the pattern is forced to be "anchored", that is, it is constrained to match only at the start of the string which is being searched (the "subject string"). This effect can also be achieved by @@ -80,7 +80,7 @@ PCRE_TABLE(5) PCRE_TABLE(5) E (default: off) Toggles the PCRE_DOLLAR_ENDONLY flag. When this - flag is set, a $ metacharacter in the pattern + flag is on, a $ metacharacter in the pattern matches only at the end of the subject string. Without this flag, a dollar also matches immedi- ately before the final character if it is a newline @@ -90,18 +90,18 @@ PCRE_TABLE(5) PCRE_TABLE(5) U (default: off) Toggles the ungreedy matching flag. When this flag - is set, the pattern matching engine inverts the + is on, the pattern matching engine inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if fol- lowed by "?". This flag can also set by a (?U) modifier within the pattern. X (default: off) - Toggles the PCRE_EXTRA flag. When this flag is - set, any backslash in a pattern that is followed by - a letter that has no special meaning causes an - error, thus reserving these combinations for future - expansion. + Toggles the PCRE_EXTRA flag. When this flag is on, + any backslash in a pattern that is followed by a + letter that has no special meaning causes an error, + thus reserving these combinations for future expan- + sion. Each pattern is applied to the entire lookup key string. Depending on the application, that string is an entire diff --git a/postfix/html/pipe.8.html b/postfix/html/pipe.8.html index 46f3cc5db..168c3d21b 100644 --- a/postfix/html/pipe.8.html +++ b/postfix/html/pipe.8.html @@ -252,8 +252,8 @@ PIPE(8) PIPE(8) Limit the time for delivery to external command, for delivery via the named transport. The default limit is taken from the command_time_limit parame- - ter. The limit is enforced by the Postfix queue - manager. + ter. The limit is enforced by the pipe delivery + agent. SEE ALSO bounce(8) non-delivery status reports diff --git a/postfix/html/postconf.1.html b/postfix/html/postconf.1.html index ef968e45c..c3c8038bc 100644 --- a/postfix/html/postconf.1.html +++ b/postfix/html/postconf.1.html @@ -73,22 +73,32 @@ POSTCONF(1) POSTCONF(1) is available only on systems with support for Berkeley DB databases. - ldap Perform lookups using the LDAP protocol. + ldap (read-only) + Perform lookups using the LDAP protocol. This is described in an LDAP_README file. - pcre A lookup table based on Perl Compatible Reg- - ular Expressions. The file format is + mysql (read-only) + Perform lookups using the MYSQL protocol. + This is described in a MYSQL_README file. + + pcre (read-only) + A lookup table based on Perl Compatible Reg- + ular Expressions. The file format is described in pcre_table(5). - regexp A lookup table based on regular expressions. - The file format is described in reg- - exp_table(5). + regexp (read-only) + A lookup table based on regular expressions. + The file format is described in reg- + exp_table(5). - static A table that always returns the same result. - For example, static:foobar always returns - the string foobar. + static (read-only) + A table that always returns its name as + lookup result. For example, static:foobar + always returns the string foobar as lookup + result. - unix A limited way to query the UNIX authentica- + unix (read-only) + A limited way to query the UNIX authentica- tion database. The following tables are implemented: diff --git a/postfix/html/postdrop.1.html b/postfix/html/postdrop.1.html index d45e5188f..be2201642 100644 --- a/postfix/html/postdrop.1.html +++ b/postfix/html/postdrop.1.html @@ -51,7 +51,7 @@ POSTDROP(1) POSTDROP(1) alternate_config_directories configuration parame- ter value. - Only the super-user is allowed to specify arbitrary + Only the superuser is allowed to specify arbitrary directory names. FILES diff --git a/postfix/html/postfix.1.html b/postfix/html/postfix.1.html index 2254bd621..78adcb06a 100644 --- a/postfix/html/postfix.1.html +++ b/postfix/html/postfix.1.html @@ -8,7 +8,7 @@ POSTFIX(1) POSTFIX(1) postfix [-c config_dir] [-D] [-v] command DESCRIPTION - This command is reserved for the super-user. To submit + This command is reserved for the superuser. To submit mail, use the Postfix sendmail command. The postfix command controls the operation of the Postfix diff --git a/postfix/html/postqueue.1.html b/postfix/html/postqueue.1.html index c5ba1927a..8540fa965 100644 --- a/postfix/html/postqueue.1.html +++ b/postfix/html/postqueue.1.html @@ -69,7 +69,7 @@ POSTQUEUE(1) POSTQUEUE(1) alternate_config_directories configuration parame- ter value. - Only the super-user is allowed to specify arbitrary + Only the superuser is allowed to specify arbitrary directory names. FILES diff --git a/postfix/html/postsuper.1.html b/postfix/html/postsuper.1.html index d4dbb09a5..44642dbb6 100644 --- a/postfix/html/postsuper.1.html +++ b/postfix/html/postsuper.1.html @@ -1,5 +1,4 @@
-
 POSTSUPER(1)                                         POSTSUPER(1)
 
 NAME
@@ -11,7 +10,7 @@ POSTSUPER(1)                                         POSTSUPER(1)
 
 DESCRIPTION
        The postsuper command does maintenance jobs on the Postfix
-       queue. Use of the command is restricted to the super-user.
+       queue.  Use of the command is restricted to the superuser.
 
        By default, postsuper performs  the  operations  requested
        with  the  -s  and  -p command-line options on all Postfix
@@ -135,6 +134,5 @@ POSTSUPER(1)                                         POSTSUPER(1)
        P.O. Box 704
        Yorktown Heights, NY 10598, USA
 
-                                                                1
-
+                                                     POSTSUPER(1)
 
diff --git a/postfix/html/rate.html b/postfix/html/rate.html index 576c06560..11fa2dc43 100644 --- a/postfix/html/rate.html +++ b/postfix/html/rate.html @@ -360,7 +360,7 @@ client. The behavior is controlled by the following parameters: -
smtpd_error_sleep_time (default: 5 seconds)
When +
smtpd_error_sleep_time (default: 1 second)
When the per-session error count is small, the SMTP server pauses only when reporting a problem to a client. The purpose is to prevent naive clients from going into a fast connect-error-disconnect @@ -378,7 +378,7 @@ per-session error count exceeds this value, the SMTP server sleeps -
smtpd_hard_error_limit (default: 100)
When +
smtpd_hard_error_limit (default: 20)
When the per-session error count exceeds this value, the SMTP server disconnects. diff --git a/postfix/html/resource.html b/postfix/html/resource.html index 4c24021b3..234b49362 100644 --- a/postfix/html/resource.html +++ b/postfix/html/resource.html @@ -77,11 +77,21 @@ an untrusted source. Long lines are reconstructed upon delivery.
How much text may be carried in a multi-line message header. Header text that does not fit in $header_size_limit bytes -overflows into the message body. This limit is enforced by the cleanup header rewriting code.

+

header_address_token_limit (default: 10240 tokens) + +
Limit on the amount of memory and CPU that Postfix will use for +rewriting addresses in message headers. The limit is expressed as +a number of tokens. Tokens text that do not fit are discarded. +This limit is enforced by the cleanup +header rewriting code. + +

+

extract_recipient_limit (default: 10240 recipients)
How many recipients Postfix will extract from message headers diff --git a/postfix/html/showq.8.html b/postfix/html/showq.8.html index a9de2ae8f..77b7c1528 100644 --- a/postfix/html/showq.8.html +++ b/postfix/html/showq.8.html @@ -13,7 +13,7 @@ SHOWQ(8) SHOWQ(8) mand. The showq daemon can also be run in stand-alone mode by - the super-user. This mode of operation is used to emulate + the superuser. This mode of operation is used to emulate the `mailq' command while the Postfix mail system is down. SECURITY diff --git a/postfix/man/man1/postconf.1 b/postfix/man/man1/postconf.1 index 02143214c..5bab9c546 100644 --- a/postfix/man/man1/postconf.1 +++ b/postfix/man/man1/postconf.1 @@ -70,19 +70,23 @@ useful someday. An indexed file type based on hashing. This is available only on systems with support for Berkeley DB databases. -.IP \fBldap\fR +.IP "\fBldap\fR (read-only)" Perform lookups using the LDAP protocol. This is described in an LDAP_README file. -.IP \fBpcre\fR +.IP "\fBmysql\fR (read-only)" +Perform lookups using the MYSQL protocol. This is described +in a MYSQL_README file. +.IP "\fBpcre\fR (read-only)" A lookup table based on Perl Compatible Regular Expressions. The file format is described in \fBpcre_table\fR(5). -.IP \fBregexp\fR +.IP "\fBregexp\fR (read-only)" A lookup table based on regular expressions. The file format is described in \fBregexp_table\fR(5). -.IP \fBstatic\fR -A table that always returns the same result. For example, -\fBstatic:foobar\fR always returns the string \fBfoobar\fR. -.IP \fBunix\fR +.IP "\fBstatic\fR (read-only)" +A table that always returns its name as lookup result. For example, +\fBstatic:foobar\fR always returns the string \fBfoobar\fR as lookup +result. +.IP "\fBunix\fR (read-only)" A limited way to query the UNIX authentication database. The following tables are implemented: .RS diff --git a/postfix/man/man1/postdrop.1 b/postfix/man/man1/postdrop.1 index 122104924..17eddc740 100644 --- a/postfix/man/man1/postdrop.1 +++ b/postfix/man/man1/postdrop.1 @@ -56,7 +56,7 @@ A non-standard directory is allowed only if the name is listed in the standard \fBmain.cf\fR file, in the \fBalternate_config_directories\fR configuration parameter value. -Only the super-user is allowed to specify arbitrary directory names. +Only the superuser is allowed to specify arbitrary directory names. .SH FILES .na .nf diff --git a/postfix/man/man1/postfix.1 b/postfix/man/man1/postfix.1 index 204cd7e2a..1b498e5e4 100644 --- a/postfix/man/man1/postfix.1 +++ b/postfix/man/man1/postfix.1 @@ -14,7 +14,7 @@ Postfix control program .SH DESCRIPTION .ad .fi -This command is reserved for the super-user. To submit mail, +This command is reserved for the superuser. To submit mail, use the Postfix \fBsendmail\fR command. The \fBpostfix\fR command controls the operation of the Postfix diff --git a/postfix/man/man1/postqueue.1 b/postfix/man/man1/postqueue.1 index f66800343..394d10b19 100644 --- a/postfix/man/man1/postqueue.1 +++ b/postfix/man/man1/postqueue.1 @@ -73,7 +73,7 @@ A non-standard directory is allowed only if the name is listed in the standard \fBmain.cf\fR file, in the \fBalternate_config_directories\fR configuration parameter value. -Only the super-user is allowed to specify arbitrary directory names. +Only the superuser is allowed to specify arbitrary directory names. .SH FILES .na .nf diff --git a/postfix/man/man1/postsuper.1 b/postfix/man/man1/postsuper.1 index 80fc63864..229d42f32 100644 --- a/postfix/man/man1/postsuper.1 +++ b/postfix/man/man1/postsuper.1 @@ -15,7 +15,7 @@ Postfix superintendent .ad .fi The \fBpostsuper\fR command does maintenance jobs on the Postfix -queue. Use of the command is restricted to the super-user. +queue. Use of the command is restricted to the superuser. By default, \fBpostsuper\fR performs the operations requested with the \fB-s\fR and \fB-p\fR command-line options on all Postfix queue diff --git a/postfix/man/man5/pcre_table.5 b/postfix/man/man5/pcre_table.5 index 2b1673d01..a17bc553c 100644 --- a/postfix/man/man5/pcre_table.5 +++ b/postfix/man/man5/pcre_table.5 @@ -44,32 +44,32 @@ characters after the pattern: Toggles the case sensitivity flag. By default, matching is case insensitive. .IP "\fBm\fR (default: off)" -Toggles the PCRE_MULTILINE flag. When the flag is on, the \fB^\fR +Toggles the PCRE_MULTILINE flag. When this flag is on, the \fB^\fR and \fb$\fR metacharacters match immediately after and immediately before a newline character, respectively, in addition to matching at the start and end of the subject string. .IP "\fBs\fR (default: on)" -Toggle the PCRE_DOTALL flag. When the flag is on, the \fB.\fR +Toggles the PCRE_DOTALL flag. When this flag is on, the \fB.\fR metacharacter matches the newline character. With Postfix versions prior to 20020528, The flag is off by default, which is inconvenient for multi-line message header matching. .IP "\fBx\fR (default: off)" -Toggles the pcre extended flag. When the flag is on, whitespace +Toggles the pcre extended flag. When this flag is on, whitespace in the pattern (other than in a character class) and characters between a \fB#\fR outside a character class and the next newline character are ignored. An escaping backslash can be used to include a whitespace or \fB#\fR character as part of the pattern. .IP "\fBA\fR (default: off)" -Toggles the PCRE_ANCHORED flag. When this flag is set, +Toggles the PCRE_ANCHORED flag. When this flag is on, the pattern is forced to be "anchored", that is, it is constrained to match only at the start of the string which is being searched (the "subject string"). This effect can also be achieved by appropriate constructs in the pattern itself. .IP "\fBE\fR (default: off)" -Toggles the PCRE_DOLLAR_ENDONLY flag. When this flag is set, +Toggles the PCRE_DOLLAR_ENDONLY flag. When this flag is on, a \fB$\fR metacharacter in the pattern matches only at the end of the subject string. Without this flag, a dollar also matches immediately before the final character if it is a @@ -77,14 +77,14 @@ newline character (but not before any other newline characters). This flag is ignored if PCRE_MULTILINE flag is set. .IP "\fBU\fR (default: off)" -Toggles the ungreedy matching flag. When this flag is set, +Toggles the ungreedy matching flag. When this flag is on, the pattern matching engine inverts the "greediness" of the quantifiers so that they are not greedy by default, but become greedy if followed by "?". This flag can also set by a (?U) modifier within the pattern. .IP "\fBX\fR (default: off)" Toggles the PCRE_EXTRA flag. -When this flag is set, any backslash in a pattern that is +When this flag is on, any backslash in a pattern that is followed by a letter that has no special meaning causes an error, thus reserving these combinations for future expansion. .PP diff --git a/postfix/man/man8/pipe.8 b/postfix/man/man8/pipe.8 index 97a9e873e..db989d670 100644 --- a/postfix/man/man8/pipe.8 +++ b/postfix/man/man8/pipe.8 @@ -227,7 +227,7 @@ The limit is enforced by the Postfix queue manager. Limit the time for delivery to external command, for delivery via the named \fBtransport\fR. The default limit is taken from the \fBcommand_time_limit\fR parameter. -The limit is enforced by the Postfix queue manager. +The limit is enforced by the pipe delivery agent. .SH SEE ALSO .na .nf diff --git a/postfix/man/man8/showq.8 b/postfix/man/man8/showq.8 index 637c1d9fb..bb2bc0a24 100644 --- a/postfix/man/man8/showq.8 +++ b/postfix/man/man8/showq.8 @@ -16,7 +16,7 @@ The \fBshowq\fR daemon reports the Postfix mail queue status. It is the program that emulates the sendmail `mailq' command. The \fBshowq\fR daemon can also be run in stand-alone mode -by the super-user. This mode of operation is used to emulate +by the superuser. This mode of operation is used to emulate the `mailq' command while the Postfix mail system is down. .SH SECURITY .na diff --git a/postfix/mantools/postlink b/postfix/mantools/postlink index f53c82d9c..ecbc01be9 100755 --- a/postfix/mantools/postlink +++ b/postfix/mantools/postlink @@ -44,7 +44,7 @@ exec sed ' s/[]*canonical[]*(5)/&<\/a>/ s/[]*etrn[]*(5)/&<\/a>/ s/[]*pcre[]*_[]*table[]*(5)/&<\/a>/ - s/[]*regexp[]*_[]*table[]*(5)/&<\/a>/ + s/[]*reg[-]*\n*[ ]*exp[]*_[]*table[]*(5)/&<\/a>/ s/[]*relocated[]*(5)/&<\/a>/ s/[]*trans[-]*\n*[ ]*port[]*(5)/&<\/a>/ s/[]*virtual[]*(5)/&<\/a>/ diff --git a/postfix/proto/pcre_table b/postfix/proto/pcre_table index e17cb7fb6..43f273df4 100644 --- a/postfix/proto/pcre_table +++ b/postfix/proto/pcre_table @@ -38,32 +38,32 @@ # Toggles the case sensitivity flag. By default, matching is case # insensitive. # .IP "\fBm\fR (default: off)" -# Toggles the PCRE_MULTILINE flag. When the flag is on, the \fB^\fR +# Toggles the PCRE_MULTILINE flag. When this flag is on, the \fB^\fR # and \fb$\fR metacharacters match immediately after and immediately # before a newline character, respectively, in addition to # matching at the start and end of the subject string. # .IP "\fBs\fR (default: on)" -# Toggle the PCRE_DOTALL flag. When the flag is on, the \fB.\fR +# Toggles the PCRE_DOTALL flag. When this flag is on, the \fB.\fR # metacharacter matches the newline character. With # Postfix versions prior to 20020528, The flag is off by # default, which is inconvenient for multi-line message header # matching. # .IP "\fBx\fR (default: off)" -# Toggles the pcre extended flag. When the flag is on, whitespace +# Toggles the pcre extended flag. When this flag is on, whitespace # in the pattern (other than in a character class) and # characters between a \fB#\fR outside a character class and # the next newline character are ignored. An escaping backslash # can be used to include a whitespace or \fB#\fR character # as part of the pattern. # .IP "\fBA\fR (default: off)" -# Toggles the PCRE_ANCHORED flag. When this flag is set, +# Toggles the PCRE_ANCHORED flag. When this flag is on, # the pattern is forced to be "anchored", that is, it is # constrained to match only at the start of the string which # is being searched (the "subject string"). This effect can # also be achieved by appropriate constructs in the pattern # itself. # .IP "\fBE\fR (default: off)" -# Toggles the PCRE_DOLLAR_ENDONLY flag. When this flag is set, +# Toggles the PCRE_DOLLAR_ENDONLY flag. When this flag is on, # a \fB$\fR metacharacter in the pattern matches only at the # end of the subject string. Without this flag, a dollar also # matches immediately before the final character if it is a @@ -71,14 +71,14 @@ # characters). This flag is ignored if PCRE_MULTILINE # flag is set. # .IP "\fBU\fR (default: off)" -# Toggles the ungreedy matching flag. When this flag is set, +# Toggles the ungreedy matching flag. When this flag is on, # the pattern matching engine inverts the "greediness" of # the quantifiers so that they are not greedy by default, # but become greedy if followed by "?". This flag can also # set by a (?U) modifier within the pattern. # .IP "\fBX\fR (default: off)" # Toggles the PCRE_EXTRA flag. -# When this flag is set, any backslash in a pattern that is +# When this flag is on, any backslash in a pattern that is # followed by a letter that has no special meaning causes an # error, thus reserving these combinations for future expansion. # .PP diff --git a/postfix/src/cleanup/cleanup_map11.c b/postfix/src/cleanup/cleanup_map11.c index 6d699d348..4d656f7c6 100644 --- a/postfix/src/cleanup/cleanup_map11.c +++ b/postfix/src/cleanup/cleanup_map11.c @@ -142,10 +142,12 @@ void cleanup_map11_tree(CLEANUP_STATE *state, TOK822 *tree, * checking in one place, instead of having error handling code all over * the place. */ +#define NO_TOKEN_LIMIT 0 + tok822_externalize(temp, tree->head, TOK822_STR_DEFL); cleanup_map11_external(state, temp, maps, propagate); tok822_free_tree(tree->head); - tree->head = tok822_scan(STR(temp), &tree->tail); + tree->head = tok822_scan(STR(temp), &tree->tail, NO_TOKEN_LIMIT); vstring_free(temp); } diff --git a/postfix/src/cleanup/cleanup_masquerade.c b/postfix/src/cleanup/cleanup_masquerade.c index b742e25ca..665bbe14a 100644 --- a/postfix/src/cleanup/cleanup_masquerade.c +++ b/postfix/src/cleanup/cleanup_masquerade.c @@ -151,10 +151,12 @@ void cleanup_masquerade_tree(TOK822 *tree, ARGV *masq_domains) { VSTRING *temp = vstring_alloc(100); +#define NO_TOKEN_LIMIT 0 + tok822_externalize(temp, tree->head, TOK822_STR_DEFL); cleanup_masquerade_external(temp, masq_domains); tok822_free_tree(tree->head); - tree->head = tok822_scan(STR(temp), &tree->tail); + tree->head = tok822_scan(STR(temp), &tree->tail, NO_TOKEN_LIMIT); vstring_free(temp); } diff --git a/postfix/src/cleanup/cleanup_message.c b/postfix/src/cleanup/cleanup_message.c index 8e94a0e8a..026e6e827 100644 --- a/postfix/src/cleanup/cleanup_message.c +++ b/postfix/src/cleanup/cleanup_message.c @@ -170,8 +170,8 @@ static void cleanup_rewrite_sender(CLEANUP_STATE *state, HEADER_OPTS *hdr_opts, * sender addresses, and regenerate the header line. Finally, pipe the * result through the header line folding routine. */ - tree = tok822_parse(vstring_str(header_buf) - + strlen(hdr_opts->name) + 1); + tree = tok822_parse(vstring_str(header_buf) + strlen(hdr_opts->name) + 1, + var_token_limit); addr_list = tok822_grep(tree, TOK822_ADDR); for (tpp = addr_list; *tpp; tpp++) { cleanup_rewrite_tree(*tpp); @@ -222,8 +222,8 @@ static void cleanup_rewrite_recip(CLEANUP_STATE *state, HEADER_OPTS *hdr_opts, * recipient addresses, and regenerate the header line. Finally, pipe the * result through the header line folding routine. */ - tree = tok822_parse(vstring_str(header_buf) - + strlen(hdr_opts->name) + 1); + tree = tok822_parse(vstring_str(header_buf) + strlen(hdr_opts->name) + 1, + var_token_limit); addr_list = tok822_grep(tree, TOK822_ADDR); for (tpp = addr_list; *tpp; tpp++) { cleanup_rewrite_tree(*tpp); @@ -501,6 +501,8 @@ static void cleanup_header_done_callback(void *context) /* * Add a missing (Resent-)From: header. */ +#define NO_TOKEN_LIMIT 0 + if ((state->headers_seen & (1 << (state->resent[0] ? HDR_RESENT_FROM : HDR_FROM))) == 0) { quote_822_local(state->temp1, *state->sender ? @@ -509,7 +511,7 @@ static void cleanup_header_done_callback(void *context) state->resent, vstring_str(state->temp1)); if (*state->sender && state->fullname && *state->fullname) { vstring_sprintf(state->temp1, "(%s)", state->fullname); - token = tok822_parse(vstring_str(state->temp1)); + token = tok822_parse(vstring_str(state->temp1), NO_TOKEN_LIMIT); vstring_strcat(state->temp2, " "); tok822_externalize(state->temp2, token, TOK822_STR_NONE); tok822_free_tree(token); diff --git a/postfix/src/cleanup/cleanup_rewrite.c b/postfix/src/cleanup/cleanup_rewrite.c index 1ae6871d8..51fb370aa 100644 --- a/postfix/src/cleanup/cleanup_rewrite.c +++ b/postfix/src/cleanup/cleanup_rewrite.c @@ -80,10 +80,12 @@ void cleanup_rewrite_tree(TOK822 *tree) VSTRING *dst = vstring_alloc(100); VSTRING *src = vstring_alloc(100); +#define NO_TOKEN_LIMIT 0 + tok822_externalize(src, tree->head, TOK822_STR_DEFL); cleanup_rewrite_external(dst, STR(src)); tok822_free_tree(tree->head); - tree->head = tok822_scan(STR(dst), &tree->tail); + tree->head = tok822_scan(STR(dst), &tree->tail, NO_TOKEN_LIMIT); vstring_free(dst); vstring_free(src); } diff --git a/postfix/src/global/mail_addr_crunch.c b/postfix/src/global/mail_addr_crunch.c index 23383e041..9bf8cc953 100644 --- a/postfix/src/global/mail_addr_crunch.c +++ b/postfix/src/global/mail_addr_crunch.c @@ -78,7 +78,9 @@ ARGV *mail_addr_crunch(const char *string, const char *extension) * the result to external (quoted) form. Optionally apply the extension * to each address found. */ - tree = tok822_parse(string); +#define NO_TOKEN_LIMIT 0 + + tree = tok822_parse(string, NO_TOKEN_LIMIT); addr_list = tok822_grep(tree, TOK822_ADDR); for (tpp = addr_list; *tpp; tpp++) { tok822_externalize(extern_addr, tpp[0]->head, TOK822_STR_DEFL); diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index 28ee3a329..1135e6aaf 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -90,6 +90,7 @@ /* int var_mime_maxdepth; /* int var_mime_bound_len; /* int var_header_limit; +/* int var_token_limit; /* int var_disable_mime_input; /* int var_disable_mime_oconv; /* int var_strict_8bitmime; @@ -242,6 +243,7 @@ int var_db_read_buf; int var_mime_maxdepth; int var_mime_bound_len; int var_header_limit; +int var_token_limit; int var_disable_mime_input; int var_disable_mime_oconv; int var_strict_8bitmime; @@ -484,6 +486,7 @@ void mail_params_init() VAR_DB_CREATE_BUF, DEF_DB_CREATE_BUF, &var_db_create_buf, 1, 0, VAR_DB_READ_BUF, DEF_DB_READ_BUF, &var_db_read_buf, 1, 0, VAR_HEADER_LIMIT, DEF_HEADER_LIMIT, &var_header_limit, 1, 0, + VAR_TOKEN_LIMIT, DEF_TOKEN_LIMIT, &var_token_limit, 1, 0, VAR_MIME_MAXDEPTH, DEF_MIME_MAXDEPTH, &var_mime_maxdepth, 1, 0, VAR_MIME_BOUND_LEN, DEF_MIME_BOUND_LEN, &var_mime_bound_len, 1, 0, 0, diff --git a/postfix/src/global/mail_params.h b/postfix/src/global/mail_params.h index 470ca02a8..6f45aa4e4 100644 --- a/postfix/src/global/mail_params.h +++ b/postfix/src/global/mail_params.h @@ -776,7 +776,7 @@ extern int var_smtpd_rcpt_limit; extern int var_smtpd_soft_erlim; #define VAR_SMTPD_HARD_ERLIM "smtpd_hard_error_limit" -#define DEF_SMTPD_HARD_ERLIM 100 +#define DEF_SMTPD_HARD_ERLIM 20 extern int var_smtpd_hard_erlim; #define VAR_SMTPD_ERR_SLEEP "smtpd_error_sleep_time" @@ -962,9 +962,13 @@ extern int var_lmtp_quit_tmout; extern int var_hopcount_limit; #define VAR_HEADER_LIMIT "header_size_limit" -#define DEF_HEADER_LIMIT 10240 +#define DEF_HEADER_LIMIT 102400 extern int var_header_limit; +#define VAR_TOKEN_LIMIT "header_address_token_limit" +#define DEF_TOKEN_LIMIT 10240 +extern int var_token_limit; + #define VAR_EXTRA_RCPT_LIMIT "extract_recipient_limit" #define DEF_EXTRA_RCPT_LIMIT 10240 extern int var_extra_rcpt_limit; @@ -1547,6 +1551,13 @@ extern bool var_strict_8bit_body; #define DEF_STRICT_ENCODING 0 extern bool var_strict_encoding; + /* + * Bizarre. + */ +#define VAR_SENDER_ROUTING "sender_based_routing" +#define DEF_SENDER_ROUTING 0 +extern bool var_sender_routing; + /* LICENSE /* .ad /* .fi diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 6334f389f..b700c5b4a 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only, unless they include the same bugfix as a patch release. */ -#define MAIL_RELEASE_DATE "20020602" +#define MAIL_RELEASE_DATE "20020605" #define VAR_MAIL_VERSION "mail_version" #define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE diff --git a/postfix/src/global/mime_trunc.in b/postfix/src/global/mime_trunc.in index 81e388029..2d66f75ae 100644 --- a/postfix/src/global/mime_trunc.in +++ b/postfix/src/global/mime_trunc.in @@ -1439,3 +1439,352 @@ Header: garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage diff --git a/postfix/src/global/mime_trunc.ref b/postfix/src/global/mime_trunc.ref index 266f4a758..c7f0c8eb3 100644 --- a/postfix/src/global/mime_trunc.ref +++ b/postfix/src/global/mime_trunc.ref @@ -3,6 +3,30 @@ MAIN Header: garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage + garbage garbage garbage garbage garbage garbage garbage garbage garbage HEADER END BODY END mime_state: warning: message header length exceeds safety limit diff --git a/postfix/src/global/tok822.h b/postfix/src/global/tok822.h index 316dfb198..3ec6cf794 100644 --- a/postfix/src/global/tok822.h +++ b/postfix/src/global/tok822.h @@ -74,9 +74,9 @@ extern TOK822 **tok822_grep(TOK822 *, int); /* * tok822_parse.c */ -extern TOK822 *tok822_scan(const char *, TOK822 **); +extern TOK822 *tok822_scan(const char *, TOK822 **, int); extern TOK822 *tok822_scan_addr(const char *); -extern TOK822 *tok822_parse(const char *); +extern TOK822 *tok822_parse(const char *, int); extern VSTRING *tok822_externalize(VSTRING *, TOK822 *, int); extern VSTRING *tok822_internalize(VSTRING *, TOK822 *, int); diff --git a/postfix/src/global/tok822_parse.c b/postfix/src/global/tok822_parse.c index 86567c7f7..eb33e50d3 100644 --- a/postfix/src/global/tok822_parse.c +++ b/postfix/src/global/tok822_parse.c @@ -6,12 +6,14 @@ /* SYNOPSIS /* #include /* -/* TOK822 *tok822_scan(str, tailp) +/* TOK822 *tok822_scan(str, tailp, limit) /* const char *str; /* TOK822 **tailp; +/* int limit; /* -/* TOK822 *tok822_parse(str) +/* TOK822 *tok822_parse(str, limit) /* const char *str; +/* int limit; /* /* TOK822 *tok822_scan_addr(str) /* const char *str; @@ -36,11 +38,15 @@ /* tok822_scan() converts the external-form string in \fIstr\fR /* to a linear token list. The \fItailp\fR argument is a null pointer /* or receives the pointer value of the last result list element. +/* The \fIlimit\fR argument is either zero or an upper bound on the +/* number of tokens produced. /* /* tok822_parse() converts the external-form address list in /* \fIstr\fR to the corresponding token tree. The parser is permissive /* and will not throw away information that it does not understand. /* The parser adds missing commas between addresses. +/* The \fIlimit\fR argument is either zero or an upper bound on the +/* number of tokens produced. /* /* tok822_scan_addr() converts the external-form string in /* \fIstr\fR to an address token tree. This is just string to @@ -316,12 +322,13 @@ static int tok822_append_space(TOK822 *tp) /* tok822_scan - tokenize string */ -TOK822 *tok822_scan(const char *str, TOK822 **tailp) +TOK822 *tok822_scan(const char *str, TOK822 **tailp, int tok_count_limit) { TOK822 *head = 0; TOK822 *tail = 0; TOK822 *tp; int ch; + int tok_count = 0; /* * XXX 2822 new feature: Section 4.1 allows "." to appear in a phrase (to @@ -357,6 +364,8 @@ TOK822 *tok822_scan(const char *str, TOK822 **tailp) } else { tail = tok822_append(tail, tp); } + if (tok_count_limit > 0 && ++tok_count >= tok_count_limit) + break; } if (tailp) *tailp = tail; @@ -365,7 +374,7 @@ TOK822 *tok822_scan(const char *str, TOK822 **tailp) /* tok822_parse - translate external string to token tree */ -TOK822 *tok822_parse(const char *str) +TOK822 *tok822_parse(const char *str, int tok_count_limit) { TOK822 *head; TOK822 *tail; @@ -381,7 +390,7 @@ TOK822 *tok822_parse(const char *str) * token list that contains all tokens, we can always convert back to * string form. */ - if ((first_token = tok822_scan(str, &last_token)) == 0) + if ((first_token = tok822_scan(str, &last_token, tok_count_limit)) == 0) return (0); /* @@ -538,7 +547,7 @@ TOK822 *tok822_scan_addr(const char *addr) { TOK822 *tree = tok822_alloc(TOK822_ADDR, (char *) 0); - tree->head = tok822_scan(addr, &tree->tail); + tree->head = tok822_scan(addr, &tree->tail, 0); return (tree); } @@ -580,6 +589,8 @@ int main(int unused_argc, char **unused_argv) TOK822 *list; VSTRING *buf = vstring_alloc(100); +#define TEST_TOKEN_LIMIT 20 + while (readlline(buf, VSTREAM_IN, (int *) 0)) { while (VSTRING_LEN(buf) > 0 && vstring_end(buf)[-1] == '\n') { vstring_end(buf)[-1] = 0; @@ -587,7 +598,7 @@ int main(int unused_argc, char **unused_argv) } if (!isatty(vstream_fileno(VSTREAM_IN))) vstream_printf(">>>%s<<<\n\n", vstring_str(buf)); - list = tok822_parse(vstring_str(buf)); + list = tok822_parse(vstring_str(buf), TEST_TOKEN_LIMIT); vstream_printf("Parse tree:\n"); tok822_print(list, 0); vstream_printf("\n"); diff --git a/postfix/src/global/tok822_rewrite.c b/postfix/src/global/tok822_rewrite.c index fd52abbf3..c6091e9f5 100644 --- a/postfix/src/global/tok822_rewrite.c +++ b/postfix/src/global/tok822_rewrite.c @@ -53,6 +53,8 @@ TOK822 *tok822_rewrite(TOK822 *addr, const char *how) * the result. Shipping external form is much simpler than shipping parse * trees. */ +#define NO_TOKEN_LIMIT 0 + tok822_externalize(input_ext_form, addr->head, TOK822_STR_DEFL); if (msg_verbose) msg_info("tok822_rewrite: input: %s", vstring_str(input_ext_form)); @@ -60,7 +62,8 @@ TOK822 *tok822_rewrite(TOK822 *addr, const char *how) if (msg_verbose) msg_info("tok822_rewrite: result: %s", vstring_str(canon_ext_form)); tok822_free_tree(addr->head); - addr->head = tok822_scan(vstring_str(canon_ext_form), &addr->tail); + addr->head = tok822_scan(vstring_str(canon_ext_form), &addr->tail, + NO_TOKEN_LIMIT); vstring_free(input_ext_form); vstring_free(canon_ext_form); diff --git a/postfix/src/local/token.c b/postfix/src/local/token.c index c427eb704..da86c06e4 100644 --- a/postfix/src/local/token.c +++ b/postfix/src/local/token.c @@ -177,7 +177,9 @@ int deliver_token_string(LOCAL_STATE state, USER_ATTR usr_attr, if (msg_verbose) msg_info("deliver_token_string: %s", string); - tree = tok822_parse(string); +#define NO_TOKEN_LIMIT 0 + + tree = tok822_parse(string, NO_TOKEN_LIMIT); for (addr = tree; addr != 0; addr = addr->next) { if (addr->type == TOK822_ADDR) { if (addr_count) diff --git a/postfix/src/nqmgr/qmgr.c b/postfix/src/nqmgr/qmgr.c index 1c19eec05..7da725d3d 100644 --- a/postfix/src/nqmgr/qmgr.c +++ b/postfix/src/nqmgr/qmgr.c @@ -337,6 +337,7 @@ int var_local_con_lim; int var_local_rcpt_lim; int var_proc_limit; bool var_verp_bounce_off; +bool var_sender_routing; static QMGR_SCAN *qmgr_incoming; static QMGR_SCAN *qmgr_deferred; @@ -561,6 +562,7 @@ int main(int argc, char **argv) static CONFIG_BOOL_TABLE bool_table[] = { VAR_ALLOW_MIN_USER, DEF_ALLOW_MIN_USER, &var_allow_min_user, VAR_VERP_BOUNCE_OFF, DEF_VERP_BOUNCE_OFF, &var_verp_bounce_off, + VAR_SENDER_ROUTING, DEF_SENDER_ROUTING, &var_sender_routing, 0, }; diff --git a/postfix/src/nqmgr/qmgr_message.c b/postfix/src/nqmgr/qmgr_message.c index 04067d734..882b1e8b8 100644 --- a/postfix/src/nqmgr/qmgr_message.c +++ b/postfix/src/nqmgr/qmgr_message.c @@ -638,7 +638,12 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message) * Resolve the destination to (transport, nexthop, address). The * result address may differ from the one specified by the sender. */ - resolve_clnt_query(recipient->address, &reply); + if (var_sender_routing == 0) { + resolve_clnt_query(recipient->address, &reply); + } else { + resolve_clnt_query(message->sender, &reply); + vstring_strcpy(reply.recipient, recipient->address); + } if (message->filter_xport) { vstring_strcpy(reply.transport, message->filter_xport); if ((nexthop = split_at(STR(reply.transport), ':')) == 0 diff --git a/postfix/src/pipe/pipe.c b/postfix/src/pipe/pipe.c index 59741bda0..edceda7cc 100644 --- a/postfix/src/pipe/pipe.c +++ b/postfix/src/pipe/pipe.c @@ -211,7 +211,7 @@ /* Limit the time for delivery to external command, for delivery via /* the named \fBtransport\fR. The default limit is taken from the /* \fBcommand_time_limit\fR parameter. -/* The limit is enforced by the Postfix queue manager. +/* The limit is enforced by the pipe delivery agent. /* SEE ALSO /* bounce(8) non-delivery status reports /* master(8) process manager diff --git a/postfix/src/postalias/postalias.c b/postfix/src/postalias/postalias.c index fdde2aafb..750be2bc1 100644 --- a/postfix/src/postalias/postalias.c +++ b/postfix/src/postalias/postalias.c @@ -249,7 +249,10 @@ static void postalias(char *map_type, char *path_name, int postalias_flags, * Tokenize the input, so that we do the right thing when a quoted * localpart contains special characters such as "@", ":" and so on. */ - if ((tok_list = tok822_scan(STR(line_buffer), (TOK822 **) 0)) == 0) +#define NO_TOKEN_LIMIT 0 + + if ((tok_list = tok822_scan(STR(line_buffer), (TOK822 **) 0, + NO_TOKEN_LIMIT)) == 0) continue; /* diff --git a/postfix/src/postconf/postconf.c b/postfix/src/postconf/postconf.c index 2f9eeb06f..7fd9a63cc 100644 --- a/postfix/src/postconf/postconf.c +++ b/postfix/src/postconf/postconf.c @@ -64,19 +64,23 @@ /* An indexed file type based on hashing. /* This is available only on systems with support for Berkeley DB /* databases. -/* .IP \fBldap\fR +/* .IP "\fBldap\fR (read-only)" /* Perform lookups using the LDAP protocol. This is described /* in an LDAP_README file. -/* .IP \fBpcre\fR +/* .IP "\fBmysql\fR (read-only)" +/* Perform lookups using the MYSQL protocol. This is described +/* in a MYSQL_README file. +/* .IP "\fBpcre\fR (read-only)" /* A lookup table based on Perl Compatible Regular Expressions. The /* file format is described in \fBpcre_table\fR(5). -/* .IP \fBregexp\fR +/* .IP "\fBregexp\fR (read-only)" /* A lookup table based on regular expressions. The file format is /* described in \fBregexp_table\fR(5). -/* .IP \fBstatic\fR -/* A table that always returns the same result. For example, -/* \fBstatic:foobar\fR always returns the string \fBfoobar\fR. -/* .IP \fBunix\fR +/* .IP "\fBstatic\fR (read-only)" +/* A table that always returns its name as lookup result. For example, +/* \fBstatic:foobar\fR always returns the string \fBfoobar\fR as lookup +/* result. +/* .IP "\fBunix\fR (read-only)" /* A limited way to query the UNIX authentication database. The /* following tables are implemented: /* .RS diff --git a/postfix/src/postdrop/postdrop.c b/postfix/src/postdrop/postdrop.c index 098614b05..6832aa9bd 100644 --- a/postfix/src/postdrop/postdrop.c +++ b/postfix/src/postdrop/postdrop.c @@ -44,7 +44,7 @@ /* standard \fBmain.cf\fR file, in the \fBalternate_config_directories\fR /* configuration parameter value. /* -/* Only the super-user is allowed to specify arbitrary directory names. +/* Only the superuser is allowed to specify arbitrary directory names. /* FILES /* /var/spool/postfix, mail queue /* /etc/postfix, configuration files diff --git a/postfix/src/postfix/postfix.c b/postfix/src/postfix/postfix.c index 2db1dc24f..5b42c30ec 100644 --- a/postfix/src/postfix/postfix.c +++ b/postfix/src/postfix/postfix.c @@ -8,7 +8,7 @@ /* \fBpostfix\fR [\fB-c \fIconfig_dir\fR] [\fB-D\fR] [\fB-v\fR] /* \fIcommand\fR /* DESCRIPTION -/* This command is reserved for the super-user. To submit mail, +/* This command is reserved for the superuser. To submit mail, /* use the Postfix \fBsendmail\fR command. /* /* The \fBpostfix\fR command controls the operation of the Postfix diff --git a/postfix/src/postqueue/postqueue.c b/postfix/src/postqueue/postqueue.c index 40210d6af..b7a11acdf 100644 --- a/postfix/src/postqueue/postqueue.c +++ b/postfix/src/postqueue/postqueue.c @@ -61,7 +61,7 @@ /* standard \fBmain.cf\fR file, in the \fBalternate_config_directories\fR /* configuration parameter value. /* -/* Only the super-user is allowed to specify arbitrary directory names. +/* Only the superuser is allowed to specify arbitrary directory names. /* FILES /* /var/spool/postfix, mail queue /* /etc/postfix, configuration files diff --git a/postfix/src/postsuper/postsuper.c b/postfix/src/postsuper/postsuper.c index 660cf9ca7..3b62ab972 100644 --- a/postfix/src/postsuper/postsuper.c +++ b/postfix/src/postsuper/postsuper.c @@ -9,7 +9,7 @@ /* [\fB-r \fIqueue_id\fR] [\fIdirectory ...\fR] /* DESCRIPTION /* The \fBpostsuper\fR command does maintenance jobs on the Postfix -/* queue. Use of the command is restricted to the super-user. +/* queue. Use of the command is restricted to the superuser. /* /* By default, \fBpostsuper\fR performs the operations requested with the /* \fB-s\fR and \fB-p\fR command-line options on all Postfix queue @@ -821,7 +821,7 @@ int main(int argc, char **argv) * owner. */ if (getuid()) - msg_fatal("use of this command is reserved for the super-user"); + msg_fatal("use of this command is reserved for the superuser"); set_ugid(var_owner_uid, var_owner_gid); /* diff --git a/postfix/src/qmgr/qmgr.c b/postfix/src/qmgr/qmgr.c index b2ea9ec6f..963532059 100644 --- a/postfix/src/qmgr/qmgr.c +++ b/postfix/src/qmgr/qmgr.c @@ -296,6 +296,7 @@ int var_local_rcpt_lim; /* XXX */ int var_local_con_lim; /* XXX */ int var_proc_limit; bool var_verp_bounce_off; +bool var_sender_routing; static QMGR_SCAN *qmgr_incoming; static QMGR_SCAN *qmgr_deferred; @@ -518,6 +519,7 @@ int main(int argc, char **argv) static CONFIG_BOOL_TABLE bool_table[] = { VAR_ALLOW_MIN_USER, DEF_ALLOW_MIN_USER, &var_allow_min_user, VAR_VERP_BOUNCE_OFF, DEF_VERP_BOUNCE_OFF, &var_verp_bounce_off, + VAR_SENDER_ROUTING, DEF_SENDER_ROUTING, &var_sender_routing, 0, }; diff --git a/postfix/src/qmgr/qmgr_message.c b/postfix/src/qmgr/qmgr_message.c index aea2e20cd..85f08a9e5 100644 --- a/postfix/src/qmgr/qmgr_message.c +++ b/postfix/src/qmgr/qmgr_message.c @@ -518,7 +518,12 @@ static void qmgr_message_resolve(QMGR_MESSAGE *message) * Resolve the destination to (transport, nexthop, address). The * result address may differ from the one specified by the sender. */ - resolve_clnt_query(recipient->address, &reply); + if (var_sender_routing == 0) { + resolve_clnt_query(recipient->address, &reply); + } else { + resolve_clnt_query(message->sender, &reply); + vstring_strcpy(reply.recipient, recipient->address); + } if (message->filter_xport) { vstring_strcpy(reply.transport, message->filter_xport); if ((nexthop = split_at(STR(reply.transport), ':')) == 0 diff --git a/postfix/src/sendmail/sendmail.c b/postfix/src/sendmail/sendmail.c index 138f38be1..9f60742de 100644 --- a/postfix/src/sendmail/sendmail.c +++ b/postfix/src/sendmail/sendmail.c @@ -379,8 +379,10 @@ static void enqueue(const int flags, const char *encoding, const char *sender, * pickup would not be able to run chrooted, and it may not be desirable * to use login names at all. */ +#define NO_TOKEN_LIMIT 0 + if (sender != 0) { - tree = tok822_parse(sender); + tree = tok822_parse(sender, NO_TOKEN_LIMIT); for (naddr = 0, tp = tree; tp != 0; tp = tp->next) if (tp->type == TOK822_ADDR) naddr++, tok822_internalize(buf, tp->head, TOK822_STR_DEFL); @@ -433,7 +435,7 @@ static void enqueue(const int flags, const char *encoding, const char *sender, rec_fputs(dst, REC_TYPE_VERP, verp_delims); if (recipients) { for (cpp = recipients; *cpp != 0; cpp++) { - tree = tok822_parse(*cpp); + tree = tok822_parse(*cpp, NO_TOKEN_LIMIT); for (tp = tree; tp != 0; tp = tp->next) { if (tp->type == TOK822_ADDR) { tok822_internalize(buf, tp->head, TOK822_STR_DEFL); diff --git a/postfix/src/showq/showq.c b/postfix/src/showq/showq.c index 8a59cbec6..c8c70855b 100644 --- a/postfix/src/showq/showq.c +++ b/postfix/src/showq/showq.c @@ -10,7 +10,7 @@ /* It is the program that emulates the sendmail `mailq' command. /* /* The \fBshowq\fR daemon can also be run in stand-alone mode -/* by the super-user. This mode of operation is used to emulate +/* by the superuser. This mode of operation is used to emulate /* the `mailq' command while the Postfix mail system is down. /* SECURITY /* .ad diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index cf2adfb46..2163dde94 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -591,15 +591,17 @@ static char *extract_addr(SMTPD_STATE *state, SMTPD_TOKEN *arg, * XXX We have only one address parser, written according to the rules of * RFC 822. That standard differs subtly from RFC 821. */ +#define NO_TOKEN_LIMIT 0 + if (msg_verbose) msg_info("%s: input: %s", myname, STR(arg->vstrval)); if (STR(arg->vstrval)[0] == '<' && STR(arg->vstrval)[LEN(arg->vstrval) - 1] == '>') { junk = mystrndup(STR(arg->vstrval) + 1, LEN(arg->vstrval) - 2); - tree = tok822_parse(junk); + tree = tok822_parse(junk, NO_TOKEN_LIMIT); myfree(junk); } else - tree = tok822_parse(STR(arg->vstrval)); + tree = tok822_parse(STR(arg->vstrval), NO_TOKEN_LIMIT); /* * Find trouble. diff --git a/postfix/src/smtpstone/smtp-sink.c b/postfix/src/smtpstone/smtp-sink.c index 24a5e2784..0b62b26df 100644 --- a/postfix/src/smtpstone/smtp-sink.c +++ b/postfix/src/smtpstone/smtp-sink.c @@ -249,7 +249,7 @@ static int data_read(SINK_STATE *state) * VSTREAM and kernel read buffers dry up. */ if (vstream_peek(state->stream) <= 0 - && peekfd(vstream_fileno(state->stream)) <= 0) + && readable(vstream_fileno(state->stream)) <= 0) return (0); } return (0); @@ -333,7 +333,7 @@ static int command_read(SINK_STATE *state) * VSTREAM and kernel read buffers dry up. */ if (vstream_peek(state->stream) <= 0 - && peekfd(vstream_fileno(state->stream)) <= 0) + && readable(vstream_fileno(state->stream)) <= 0) return (0); } diff --git a/postfix/src/trivial-rewrite/resolve.c b/postfix/src/trivial-rewrite/resolve.c index 7a7db6fa3..00cdccc56 100644 --- a/postfix/src/trivial-rewrite/resolve.c +++ b/postfix/src/trivial-rewrite/resolve.c @@ -134,10 +134,13 @@ void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop, /* * A lone empty string becomes the postmaster. */ +#define NO_TOKEN_LIMIT 0 + if (tree->head == tree->tail && tree->head->type == TOK822_QSTRING && VSTRING_LEN(tree->head->vstr) == 0) { tok822_free(tree->head); - tree->head = tok822_scan(MAIL_ADDR_POSTMASTER, &tree->tail); + tree->head = tok822_scan(MAIL_ADDR_POSTMASTER, &tree->tail, + NO_TOKEN_LIMIT); rewrite_tree(REWRITE_CANON, tree); } @@ -195,7 +198,8 @@ void resolve_addr(char *addr, VSTRING *channel, VSTRING *nexthop, saved_domain = 0; } else { tok822_sub_append(tree, tok822_alloc('@', (char *) 0)); - tok822_sub_append(tree, tok822_scan(var_myhostname, (TOK822 **) 0)); + tok822_sub_append(tree, tok822_scan(var_myhostname, (TOK822 **) 0, + NO_TOKEN_LIMIT)); } } tok822_internalize(nextrcpt, tree, TOK822_STR_DEFL); diff --git a/postfix/src/trivial-rewrite/rewrite.c b/postfix/src/trivial-rewrite/rewrite.c index 9ff6a12f0..22a3e2f72 100644 --- a/postfix/src/trivial-rewrite/rewrite.c +++ b/postfix/src/trivial-rewrite/rewrite.c @@ -151,9 +151,12 @@ void rewrite_tree(char *unused_ruleset, TOK822 *tree) /* * Append missing @origin */ +#define NO_TOKEN_LIMIT 0 + else if (var_append_at_myorigin != 0) { domain = tok822_sub_append(tree, tok822_alloc('@', (char *) 0)); - tok822_sub_append(tree, tok822_scan(var_myorigin, (TOK822 **) 0)); + tok822_sub_append(tree, tok822_scan(var_myorigin, (TOK822 **) 0, + NO_TOKEN_LIMIT)); } } @@ -165,7 +168,8 @@ void rewrite_tree(char *unused_ruleset, TOK822 *tree) && tok822_find_type(domain, TOK822_DOMLIT) == 0 && tok822_find_type(domain, '.') == 0) { tok822_sub_append(tree, tok822_alloc('.', (char *) 0)); - tok822_sub_append(tree, tok822_scan(var_mydomain, (TOK822 **) 0)); + tok822_sub_append(tree, tok822_scan(var_mydomain, (TOK822 **) 0, + NO_TOKEN_LIMIT)); } /*