]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.4-20061201
authorWietse Venema <wietse@porcupine.org>
Fri, 1 Dec 2006 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:32:39 +0000 (06:32 +0000)
76 files changed:
postfix/AAAREADME
postfix/HISTORY
postfix/README_FILES/ADDRESS_REWRITING_README
postfix/README_FILES/BACKSCATTER_README
postfix/README_FILES/DEBUG_README
postfix/conf/post-install
postfix/html/ADDRESS_REWRITING_README.html
postfix/html/BACKSCATTER_README.html
postfix/html/DEBUG_README.html
postfix/html/Makefile.in
postfix/html/postconf.5.html
postfix/man/Makefile.in
postfix/man/man5/postconf.5
postfix/proto/ADDRESS_REWRITING_README.html
postfix/proto/BACKSCATTER_README.html
postfix/proto/DEBUG_README.html
postfix/proto/Makefile.in
postfix/proto/postconf.proto
postfix/src/anvil/Makefile.in
postfix/src/bounce/Makefile.in
postfix/src/cleanup/Makefile.in
postfix/src/cleanup/cleanup_message.c
postfix/src/cleanup/cleanup_milter.c
postfix/src/cleanup/cleanup_out.c
postfix/src/discard/Makefile.in
postfix/src/dns/Makefile.in
postfix/src/error/Makefile.in
postfix/src/flush/Makefile.in
postfix/src/fsstone/Makefile.in
postfix/src/global/Makefile.in
postfix/src/global/dict_proxy.c
postfix/src/global/mail_version.h
postfix/src/global/mime_state.c
postfix/src/global/resolve_clnt.c
postfix/src/global/rewrite_clnt.c
postfix/src/global/scache_clnt.c
postfix/src/global/verify_clnt.c
postfix/src/local/Makefile.in
postfix/src/master/Makefile.in
postfix/src/milter/Makefile.in
postfix/src/milter/milter8.c
postfix/src/oqmgr/Makefile.in
postfix/src/oqmgr/qmgr_entry.c
postfix/src/pickup/Makefile.in
postfix/src/pipe/Makefile.in
postfix/src/postalias/Makefile.in
postfix/src/postcat/Makefile.in
postfix/src/postconf/Makefile.in
postfix/src/postdrop/Makefile.in
postfix/src/postfix/Makefile.in
postfix/src/postkick/Makefile.in
postfix/src/postlock/Makefile.in
postfix/src/postlog/Makefile.in
postfix/src/postmap/Makefile.in
postfix/src/postqueue/Makefile.in
postfix/src/postsuper/Makefile.in
postfix/src/proxymap/Makefile.in
postfix/src/qmgr/Makefile.in
postfix/src/qmgr/qmgr_job.c
postfix/src/qmgr/qmgr_message.c
postfix/src/qmqpd/Makefile.in
postfix/src/scache/Makefile.in
postfix/src/sendmail/Makefile.in
postfix/src/showq/Makefile.in
postfix/src/smtp/Makefile.in
postfix/src/smtpd/Makefile.in
postfix/src/smtpstone/Makefile.in
postfix/src/spawn/Makefile.in
postfix/src/tls/Makefile.in
postfix/src/tlsmgr/Makefile.in
postfix/src/trivial-rewrite/Makefile.in
postfix/src/util/Makefile.in
postfix/src/verify/Makefile.in
postfix/src/virtual/Makefile.in
postfix/src/xsasl/Makefile.in
postfix/src/xsasl/xsasl_cyrus_client.c

index d68a0f16d181c9528cc566b6b8aabf034c304a27..e78b4d8e17f125edc43b58d2d384c8b59ba5d026 100644 (file)
@@ -135,7 +135,6 @@ Postfix daemons:
     src/cleanup/       Canonicalize and enqueue mail
     src/discard/       Trivial discard mailer
     src/error/         Trivial error mailer
-    src/lmtp/          LMTP client
     src/local/         Local delivery
     src/master/                Postfix resident superserver
     src/oqmgr/         Old queue manager
@@ -144,9 +143,10 @@ Postfix daemons:
     src/qmgr/          Queue manager
     src/qmqpd/         QMQPD server
     src/showq/         List Postfix queue status
-    src/smtp/          SMTP client
+    src/smtp/          SMTP and LMTP client
     src/smtpd/         SMTP server
     src/spawn/         Run non-Postfix server
+    src/tlsmgr/                TLS session keys and random pool
     src/trivial-rewrite/ Address rewriting and resolving
     src/verify/                address verification service
     src/virtual/       virtual mailbox-only delivery agent
index 2891b9e4b94137f9f1babbe336427a60736aa5c1..254e1d15f119d754db71c8b5e36a785cb0ab1cec 100644 (file)
@@ -12814,8 +12814,62 @@ Apologies for any names omitted.
        response on a cached SMTP/LMTP connection.  Report by Brian
        Kantor.  Fix by Victor Duchovni.  File: smtp/smtp_reuse.c.
 
+20061113
+
+       Bugfix: the Postfix install/upgrade procedure broke with
+       non-default config_directory. File: conf/post-install.
+
+20061115
+
+       Bugfix: null pointer bug in end-of-header Milter action
+       when the last header line is too large.  Reported by Mark
+       Martinec. The root of the problem is that the MIME state
+       engine may execute up to three call-back functions when it
+       reaches the end of the headers, before it returns to the
+       caller; as long as call-backs return no result, each call-back
+       has to check for itself if a previous call-back ran into a
+       problem.  File: milter/milter8.c.
+
+       Workaround: reduce effective header_size_limit to 60000
+       when Milter inspection is enabled, to avoid breaking the
+       Milter protocol request length limit. File:
+       cleanup/cleanup_message.c.
+
+20061123
+
+       Workaround: more agressive early refill of in-memory
+       recipients to prevent a worst-case scenario where the queue
+       manager became starved until after the last batch of slow
+       in-memory recipients of jumbo multi-recipient mail. Files:
+       qmgr/qmgr_job.c.
+
+       Safety: don't read more than 5000 recipients at a time, to
+       avoid spending too much time away from interrupts.  File:
+       qmgr/qmgr_message.c.
+       
+20061201
+
+       Workaround: don't complain in the trivial-rewrite, verify,
+       proxymap or connection cache client when the server exits
+       after the client sends its request. We still complain,
+       however, when the problem persists.  Files: global/rewrite_clnt.c,
+       global/resolve_clnt.c, global/verify_clnt.c, global/scache_clnt.c,
+       global/dict_proxy.c.
+
+       Safety: the header_size_limit is now enforced more strictly,
+       to avoid inter-operability problems with the Milter protocol.
+       Long headers are truncated at a line boundary if possible,
+       otherwise they are cut between line boundaries. File:
+       cleanup/cleanup_out.c.
+
 Wish list:
 
+       Investigate if clients of single-instance servers such as
+       tlsmgr, verify, can close sockets earlier.
+
+       REDIRECT should override original recipient info, and
+       probably override DSN as well.
+
        Find out if with Sendmail, a Milter "add recipient" request
        results in NOTIFY=NONE as Postfix does now.
 
index 5a701344a87b3b195edbf80a1d176adf25fe77d1..4ac6cb4e614f4856a7e8d14acbe6ceded74fc545 100644 (file)
@@ -787,14 +787,14 @@ mailbox, or delivery to non-Postfix command.
     Content-Description: Notification
     Content-Type: text/plain
 
-    This is the Postfix program at host spike.porcupine.org.
+    This is the mail system at host spike.porcupine.org.
 
     Enclosed is the mail delivery report that you requested.
 
-                            The Postfix program
+                            The mail system
 
     <postfix-users@postfix.org>: delivery via mail.cloud9.net[168.100.1.4]: 250
-    Ok
+    2.1.5 Ok
 
 The second part of the report is in machine-readable form, and includes the
 following information:
@@ -814,13 +814,13 @@ version 2.3 and later.
     Reporting-MTA: dns; spike.porcupine.org
     X-Postfix-Queue-ID: 84863BC0E5
     X-Postfix-Sender: rfc822; wietse@porcupine.org
-    Arrival-Date: Tue, 13 Apr 2004 19:27:43 -0400 (EDT)
+    Arrival-Date: Sun, 26 Nov 2006 17:01:01 -0500 (EST)
 
     Final-Recipient: rfc822; postfix-users@postfix.org
     Action: deliverable
-    Status: 2.0.0
+    Status: 2.1.5
     Remote-MTA: dns; mail.cloud9.net
-    Diagnostic-Code: smtp; 250 Ok
+    Diagnostic-Code: smtp; 250 2.1.5 Ok
 
 The third part of the report contains the message that Postfix would have
 delivered, including From: and To: message headers, so that you can see any
@@ -831,10 +831,10 @@ no body content so none is shown in the example below.
     Content-Type: message/rfc822
 
     Received: by spike.porcupine.org (Postfix, from userid 1001)
-            id 84863BC0E5; Tue, 13 Apr 2004 19:27:43 -0400 (EDT)
+            id 84863BC0E5; id DA77DBC0A9; Sun, 26 Nov 2006 17:01:01 -0500 (EST)
     Subject: probe
     To: postfix-users@postfix.org
-    Message-Id: <20040413232743.84863BC0E5@spike.porcupine.org>
-    Date: Tue, 13 Apr 2004 19:27:43 -0400 (EDT)
+    Message-Id: <20061126220101.84863BC0E5@spike.porcupine.org>
+    Date: Sun, 26 Nov 2006 17:01:01 -0500 (EST)
     From: wietse@porcupine.org (Wietse Venema)
 
index 78646f22d135b6e35bd2cb63d5bcbf2ba3ba232a..fcde09c054e0f45cb8c8fbfb49e2b1ee9d09f847 100644 (file)
@@ -12,7 +12,7 @@ Topics covered in this document:
   * How do I block backscatter mail to random recipient addresses?
   * How do I block backscatter mail to real recipient addresses?
 
-      o Blocking backscatter mail with forged HELO information
+      o Blocking backscatter mail with forged mail server information
       o Blocking backscatter mail with forged sender information
       o Blocking backscatter mail with other forged information
       o Blocking backscatter mail from virus scanners
@@ -45,7 +45,7 @@ headers of the undeliverable mail in the non-delivery notification. These
 message headers contain information that you can use to recognize and block
 forged mail.
 
-B\bBl\blo\boc\bck\bki\bin\bng\bg b\bba\bac\bck\bks\bsc\bca\bat\btt\bte\ber\br m\bma\bai\bil\bl w\bwi\bit\bth\bh f\bfo\bor\brg\bge\bed\bH\bHE\bEL\bLO\bO i\bin\bnf\bfo\bor\brm\bma\bat\bti\bio\bon\bn
+B\bBl\blo\boc\bck\bki\bin\bng\bg b\bba\bac\bck\bks\bsc\bca\bat\btt\bte\ber\br m\bma\bai\bil\bl w\bwi\bit\bth\bh f\bfo\bor\brg\bge\bed\bm\bma\bai\bil\bl s\bse\ber\brv\bve\ber\br i\bin\bnf\bfo\bor\brm\bma\bat\bti\bio\bon\bn
 
 Although my email address is "wietse@porcupine.org", all my mail systems
 announce themselves with the SMTP HELO command as "hostname.porcupine.org".
@@ -67,6 +67,13 @@ result of forgery:
     Received: from host.example.com (HELO porcupine.org) ...
     Received: from host.example.com (EHLO porcupine.org) ...
 
+Some forgeries show up in the way that a mail server reports itself in
+Received: message headers. Keeping in mind that all my systems have a mail
+server name of hostname.porcupine.org, the following is definitely a forgery:
+
+    Received: by porcupine.org ...
+    Received: from host.example.com ( ... ) by porcupine.org ...
+
 Another frequent sign of forgery is the Message-ID: header. My systems produce
 a Message-ID: of <stuff@hostname.porcupine.org>. The following are forgeries,
 especially the first one:
@@ -82,20 +89,28 @@ this:
         body_checks = regexp:/etc/postfix/body_checks
 
     /etc/postfix/header_checks:
+        if /^Received:/
         /^Received: +from +(porcupine\.org) +/
             reject forged client name in Received: header: $1
         /^Received: +from +[^ ]+ +\(([^ ]+ +[he]+lo=|[he]+lo +)
     (porcupine\.org)\)/
             reject forged client name in Received: header: $2
+        /^Received:.* +by +(porcupine\.org)[[:>:]]/
+            reject forged mail server name in Received: header: $1
+        endif
         /^Message-ID:.*@(porcupine\.org)/
        reject forged domain name in Message-ID: header: $1
 
     /etc/postfix/body_checks:
+        if /^[> ]*Received:/
         /^[> ]*Received: +from +(porcupine\.org) /
             reject forged client name in Received: header: $1
         /^[> ]*Received: +from +[^ ]+ +\(([^ ]+ +[he]+lo=|[he]+lo +)
     (porcupine\.org)\)/
             reject forged client name in Received: header: $2
+        /^[> ]*Received:.* +by +(porcupine\.org)[[:>:]]/
+            reject forged mail server name in Received: header: $1
+        endif
         /^[> ]*Message-ID:.*@(porcupine\.org)/
        reject forged domain name in Message-ID: header: $1
 
@@ -110,6 +125,12 @@ Notes:
   * The "\(" and "\)" match "(" and ")" literally. Without the "\", the "(" and
     ")" would be grouping operators.
 
+  * The "[[:>:]]" matches the end of a word. On some systems you should specify
+    "\>" instead. For details see your system documentation.
+
+  * The "if /pattern/" and "endif" eliminate unnecessary matching attempts. DO
+    NOT indent lines starting with /pattern/ between the "if" and "endif"!
+
 C\bCa\bav\bve\bea\bat\bts\bs
 
 Netscape Messenger (and reportedly, Mozilla) sends a HELO name that is
index da0cb445a8b6deeb0385692c5905281fd8bfc049..bb2ee7393303443ac3326d1aa5f6d149cf554506 100644 (file)
@@ -25,7 +25,8 @@ follows:
   * Making Postfix daemon programs more verbose
   * Manually tracing a Postfix daemon process
   * Automatically tracing a Postfix daemon process
-  * Running daemon programs with the interactive xxgdb debugger
+  * Running daemon programs with the interactive ddd debugger
+  * Running daemon programs with the interactive gdb debugger
   * Running daemon programs under a non-interactive debugger
   * Unreasonable behavior
   * Reporting problems to postfix-users@postfix.org
@@ -208,18 +209,18 @@ the call tracer of your choice, for example:
 
 Type "p\bpo\bos\bst\btf\bfi\bix\bx r\bre\bel\blo\boa\bad\bd" and watch the logfile.
 
-R\bRu\bun\bnn\bni\bin\bng\bg d\bda\bae\bem\bmo\bon\bn p\bpr\bro\bog\bgr\bra\bam\bms\bs w\bwi\bit\bth\bh t\bth\bhe\be i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\bx\bxx\bxg\bgd\bdb\bb d\bde\beb\bbu\bug\bgg\bge\ber\br
+R\bRu\bun\bnn\bni\bin\bng\bg d\bda\bae\bem\bmo\bon\bn p\bpr\bro\bog\bgr\bra\bam\bms\bs w\bwi\bit\bth\bh t\bth\bhe\be i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\bd\bdd\bdd\bd d\bde\beb\bbu\bug\bgg\bge\ber\br
 
 If you have X Windows installed on the Postfix machine, then an interactive
-debugger such as x\bxx\bxg\bgd\bdb\bb can be convenient.
+debugger such as d\bdd\bdd\bd can be convenient.
 
 Edit the debugger_command definition in /etc/postfix/main.cf so that it invokes
-x\bxx\bxg\bgd\bdb\bb:
+d\bdd\bdd\bd:
 
     /etc/postfix/main.cf:
         debugger_command =
              PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
-             xxgdb $daemon_directory/$process_name $process_id & sleep 5
+             ddd $daemon_directory/$process_name $process_id & sleep 5
 
 Be sure that g\bgd\bdb\bb is in the command search path, and export X\bXA\bAU\bUT\bTH\bHO\bOR\bRI\bIT\bTY\bY so that X
 access control works, for example:
@@ -239,6 +240,37 @@ the proper X\bXA\bAU\bUT\bTH\bHO\bOR\bRI\bIT\bTY\bY and D\bDI\bIS\bSP\bPL\bLA\bAY\bY settings.
 Whenever the suspect daemon process is started, a debugger window pops up and
 you can watch in detail what happens.
 
+R\bRu\bun\bnn\bni\bin\bng\bg d\bda\bae\bem\bmo\bon\bn p\bpr\bro\bog\bgr\bra\bam\bms\bs w\bwi\bit\bth\bh t\bth\bhe\be i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\be g\bgd\bdb\bb d\bde\beb\bbu\bug\bgg\bge\ber\br
+
+If you have the screen command installed on the Postfix machine, then you can
+run an interactive debugger such as g\bgd\bdb\bb as follows.
+
+Edit the debugger_command definition in /etc/postfix/main.cf so that it runs
+g\bgd\bdb\bb inside a detached s\bsc\bcr\bre\bee\ben\bn session:
+
+    /etc/postfix/main.cf:
+        debugger_command =
+            PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; HOME=/root;
+            export HOME; screen -e^tt -dmS $process_name gdb
+            $daemon_directory/$process_name $process_id & sleep 2
+
+Be sure that g\bgd\bdb\bb is in the command search path.
+
+Append a -\b-D\bD option to the suspect daemon definition in /etc/postfix/master.cf,
+for example:
+
+    /etc/postfix/master.cf:
+        smtp      inet  n       -       n       -       -       smtpd -D
+
+Execute the command "p\bpo\bos\bst\btf\bfi\bix\bx r\bre\bel\blo\boa\bad\bd" and wait until a daemon process is started
+(you can see this in the maillog file).
+
+Then attach to the screen, and debug away:
+
+    # HOME=/root screen -r
+    gdb) continue
+    gdb) where
+
 R\bRu\bun\bnn\bni\bin\bng\bg d\bda\bae\bem\bmo\bon\bn p\bpr\bro\bog\bgr\bra\bam\bms\bs u\bun\bnd\bde\ber\br a\ba n\bno\bon\bn-\b-i\bin\bnt\bte\ber\bra\bac\bct\bti\biv\bve\be d\bde\beb\bbu\bug\bgg\bge\ber\br
 
 If you do not have X Windows installed on the Postfix machine, or if you are
index c64ff19f6164d0a5791d2b0f343098f7942f3c5c..54b3b93bcceb4820c062ed389744328d8f0cf24c 100644 (file)
@@ -589,14 +589,14 @@ EOF
     # This safety net is also documented in LOCAL_RECIPIENT_README.
 
     unknown_local=unknown_local_recipient_reject_code
-    has_lrm=`$POSTCONF -n local_recipient_maps`
-    has_lrjc=`$POSTCONF -n $unknown_local`
+    has_lrm=`$POSTCONF -c $config_directory -n local_recipient_maps`
+    has_lrjc=`$POSTCONF -c $config_directory -n $unknown_local`
 
     if [ -z "$has_lrm" -a -z "$has_lrjc" ]
     then
        echo SAFETY: editing main.cf, setting $unknown_local=450.
        echo See the LOCAL_RECIPIENT_README file for details.
-       $POSTCONF -e "$unknown_local = 450" || exit 1
+       $POSTCONF -c $config_directory -e "$unknown_local = 450" || exit 1
     fi
 
     # Add missing proxymap service to master.cf.
@@ -678,8 +678,8 @@ EOF
 
 test -n "$first_install_reminder" && {
 
-    ALIASES=`$POSTCONF -h alias_database | sed 's/^[^:]*://'`
-    NEWALIASES_PATH=`$POSTCONF -h newaliases_path`
+    ALIASES=`$POSTCONF -c $config_directory -h alias_database | sed 's/^[^:]*://'`
+    NEWALIASES_PATH=`$POSTCONF -c $config_directory -h newaliases_path`
     cat <<EOF | ${FMT}
 
     Warning: you still need to edit myorigin/mydestination/mynetworks
index 4c1c53813ecbc636d52c38782fd33268c5d6c940..fd580115a35668e70dd3af75e4d76446cab17660 100644 (file)
@@ -1174,13 +1174,13 @@ to mailbox, or delivery to non-Postfix command. </p>
 Content-Description: Notification
 Content-Type: text/plain
 
-This is the Postfix program at host spike.porcupine.org.
+This is the mail system at host spike.porcupine.org.
 
 Enclosed is the mail delivery report that you requested.
 
-                        The Postfix program
+                        The mail system
 
-&lt;postfix-users@postfix.org&gt;: delivery via mail.cloud9.net[168.100.1.4]: 250 Ok
+&lt;postfix-users@postfix.org&gt;: delivery via mail.cloud9.net[168.100.1.4]: 250 2.1.5 Ok
 </pre>
 </blockquote>
 
@@ -1210,13 +1210,13 @@ Content-Type: message/delivery-status
 Reporting-MTA: dns; spike.porcupine.org
 X-Postfix-Queue-ID: 84863BC0E5
 X-Postfix-Sender: rfc822; wietse@porcupine.org
-Arrival-Date: Tue, 13 Apr 2004 19:27:43 -0400 (EDT)
+Arrival-Date: Sun, 26 Nov 2006 17:01:01 -0500 (EST)
 
 Final-Recipient: rfc822; postfix-users@postfix.org
 Action: deliverable
-Status: 2.0.0
+Status: 2.1.5
 Remote-MTA: dns; mail.cloud9.net
-Diagnostic-Code: smtp; 250 Ok
+Diagnostic-Code: smtp; 250 2.1.5 Ok
 </pre>
 </blockquote>
 
@@ -1232,11 +1232,11 @@ Content-Description: Message
 Content-Type: message/rfc822
 
 Received: by spike.porcupine.org (Postfix, from userid 1001)
-        id 84863BC0E5; Tue, 13 Apr 2004 19:27:43 -0400 (EDT)
+        id 84863BC0E5; id DA77DBC0A9; Sun, 26 Nov 2006 17:01:01 -0500 (EST)
 Subject: probe
 To: postfix-users@postfix.org
-Message-Id: &lt;20040413232743.84863BC0E5@spike.porcupine.org&gt;
-Date: Tue, 13 Apr 2004 19:27:43 -0400 (EDT)
+Message-Id: &lt;20061126220101.84863BC0E5@spike.porcupine.org&gt;
+Date: Sun, 26 Nov 2006 17:01:01 -0500 (EST)
 From: wietse@porcupine.org (Wietse Venema)
 </pre>
 </blockquote>
index a007603bdfae217de7bdab09136905da657c22b6..83a673d0f24e13a5a5c2cc42a64dcd266fd57ffb 100644 (file)
@@ -38,7 +38,7 @@ recipient addresses?</a>
 <ul>
 
 <li><a href="#forged_helo">Blocking backscatter mail with forged
-HELO information</a>
+mail server information</a>
 
 <li><a href="#forged_sender">Blocking backscatter mail with forged
 sender information</a>
@@ -91,7 +91,7 @@ information that you can use to recognize and block forged mail.
 </p>
 
 <h3><a name="forged_helo">Blocking backscatter mail with forged
-HELO information</a></h3>
+mail server information</a></h3>
 
 <p> Although my email address is "wietse@porcupine.org", all my
 mail systems announce themselves with the SMTP HELO command as
@@ -127,6 +127,18 @@ Received: from host.example.com (EHLO porcupine.org) ...
 </pre>
 </blockquote>
 
+<p> Some forgeries show up in the way that a mail server reports
+itself in Received: message headers. Keeping in mind that all my
+systems have a mail server name of <i>hostname</i>.porcupine.org,
+the following is definitely a forgery:</p>
+
+<blockquote>
+<pre>
+Received: by porcupine.org ...
+Received: from host.example.com ( ... ) by porcupine.org ...
+</pre>
+</blockquote>
+
 <p> Another frequent sign of forgery is the Message-ID: header. My
 systems produce a Message-ID: of
 &lt;<i>stuff</i>@<i>hostname</i>.porcupine.org&gt;.  The following
@@ -149,18 +161,26 @@ patterns like this: </p>
     <a href="postconf.5.html#body_checks">body_checks</a> = <a href="regexp_table.5.html">regexp</a>:/etc/postfix/body_checks
 
 /etc/postfix/header_checks:
+    if /^Received:/
     /^Received: +from +(porcupine\.org) +/
         reject forged client name in Received: header: $1
     /^Received: +from +[^ ]+ +\(([^ ]+ +[he]+lo=|[he]+lo +)(porcupine\.org)\)/
         reject forged client name in Received: header: $2
+    /^Received:.* +by +(porcupine\.org)[[:&gt;:]]/
+        reject forged mail server name in Received: header: $1
+    endif
     /^Message-ID:.*@(porcupine\.org)/
        reject forged domain name in Message-ID: header: $1
 
 /etc/postfix/body_checks:
+    if /^[&gt; ]*Received:/
     /^[&gt; ]*Received: +from +(porcupine\.org) /
         reject forged client name in Received: header: $1
     /^[&gt; ]*Received: +from +[^ ]+ +\(([^ ]+ +[he]+lo=|[he]+lo +)(porcupine\.org)\)/
         reject forged client name in Received: header: $2
+    /^[&gt; ]*Received:.* +by +(porcupine\.org)[[:&gt;:]]/
+        reject forged mail server name in Received: header: $1
+    endif
     /^[&gt; ]*Message-ID:.*@(porcupine\.org)/
        reject forged domain name in Message-ID: header: $1
 </pre>
@@ -181,6 +201,14 @@ the "<tt>\</tt>", the "<tt>.</tt>" would match any character. </p>
 and "<tt>)</tt>" literally. Without the "<tt>\</tt>", the "<tt>(</tt>"
 and "<tt>)</tt>" would be grouping operators.  </p>
 
+<li> <p> The "<tt>[[:&gt;:]]</tt>" matches the end of a word. On
+some systems you should specify "<tt>\&gt;</tt>" instead. For details
+see your system documentation. </p>
+
+<li> <p> The "if /pattern/" and "endif" eliminate unnecessary
+matching attempts. DO NOT indent lines starting with /pattern/
+between the "if" and "endif"! </p>
+
 </ul>
 
 <p><a name="caveats"><strong>Caveats</strong></a></p>
@@ -251,7 +279,7 @@ reality, my patterns list multiple email addresses as
 <li> <p> The "<tt>[[:&lt;:]]</tt>" and "<tt>[[:&gt;:]]</tt>" match
 the beginning and end of a word, respectively. On some systems you
 should specify "<tt>\&lt;</tt>" and "<tt>\&gt;</tt>" instead. For
-details see your system documentation.
+details see your system documentation. </p>
 
 <li> <p> The "<tt>\.</tt>" matches "<tt>.</tt>" literally. Without
 the "<tt>\</tt>", the "<tt>.</tt>" would match any character. </p>
index 71fdfd08e4cd175624695c8573a78691f45b59dc..0f785d55b04acee50450d0f4b46611d076a5240b 100644 (file)
@@ -24,7 +24,7 @@ system when things do not work according to expectation. The methods
 vary from making Postfix log a lot of detail, to running some daemon
 processes under control of a call tracer or debugger. </p>
 
-<p> The text assumes that the Postfix main.cf and master.cf
+<p> The text assumes that the Postfix <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a>
 configuration files are stored in directory /etc/postfix. You can
 use the command "<b>postconf <a href="postconf.5.html#config_directory">config_directory</a></b>" to find out the
 actual location of this directory on your machine. </p>
@@ -54,8 +54,11 @@ sniffer</a>
 <li><a href="#auto_trace">Automatically tracing a Postfix daemon
 process</a>
 
-<li><a href="#xxgdb">Running daemon programs with the interactive
-xxgdb debugger</a>
+<li><a href="#ddd">Running daemon programs with the interactive
+ddd debugger</a>
+
+<li><a href="#screen">Running daemon programs with the interactive
+gdb debugger</a>
 
 <li><a href="#gdb">Running daemon programs under a non-interactive
 debugger</a>
@@ -153,7 +156,7 @@ section at the end of the <a href="ADDRESS_REWRITING_README.html">ADDRESS_REWRIT
 
 <h2><a name="no_chroot">Try turning off chroot operation in master.cf</a></h2>
 
-<p> A common mistake is to turn on chroot operation in the master.cf
+<p> A common mistake is to turn on chroot operation in the <a href="master.5.html">master.cf</a>
 file without going through all the necessary steps to set up a
 chroot environment. This causes Postfix daemon processes to fail
 due to all kinds of missing files. </p>
@@ -163,7 +166,7 @@ chroot turned off: </p>
 
 <blockquote>
 <pre>
-/etc/postfix/master.cf:
+/etc/postfix/<a href="master.5.html">master.cf</a>:
     # =============================================================
     # service type  private unpriv  <b>chroot</b>  wakeup  maxproc command
     #               (yes)   (yes)   <b>(yes)</b>   (never) (100)
@@ -172,8 +175,8 @@ chroot turned off: </p>
 </pre>
 </blockquote>
 
-<p> Inspect master.cf for any processes that have chroot operation
-not turned off. If you find any, save a copy of the master.cf file,
+<p> Inspect <a href="master.5.html">master.cf</a> for any processes that have chroot operation
+not turned off. If you find any, save a copy of the <a href="master.5.html">master.cf</a> file,
 and edit the entries in question.  After executing the command
 "<b>postfix reload</b>", see if the problem has gone away. </p>
 
@@ -187,14 +190,14 @@ prepare Postfix for chrooted operation. </p>
 <h2><a name="debug_peer">Verbose logging for specific SMTP
 connections</a></h2>
 
-<p> In /etc/postfix/main.cf, list the remote site name or address
+<p> In /etc/postfix/<a href="postconf.5.html">main.cf</a>, list the remote site name or address
 in the <a href="postconf.5.html#debug_peer_list">debug_peer_list</a> parameter. For example, in order to make
 the software log a lot of information to the syslog daemon for
 connections from or to the loopback interface: </p>
 
 <blockquote>
 <pre>
-/etc/postfix/main.cf:
+/etc/postfix/<a href="postconf.5.html">main.cf</a>:
     <a href="postconf.5.html#debug_peer_list">debug_peer_list</a> = 127.0.0.1
 </pre>
 </blockquote>
@@ -223,13 +226,13 @@ utility that is available from <a href="ftp://ftp.porcupine.org/pub/debugging/">
 <h2><a name="verbose">Making Postfix daemon programs more verbose</a></h2>
 
 <p> Append one or more "<b>-v</b>" options to selected daemon
-definitions in /etc/postfix/master.cf and type "<b>postfix reload</b>".
+definitions in /etc/postfix/<a href="master.5.html">master.cf</a> and type "<b>postfix reload</b>".
 This will cause a lot of activity to be logged to the syslog daemon.
 Example: </p>
 
 <blockquote>
 <pre>
-/etc/postfix/master.cf:
+/etc/postfix/<a href="master.5.html">master.cf</a>:
     smtp      inet  n       -       n       -       -       smtpd -v
 </pre>
 </blockquote>
@@ -291,22 +294,22 @@ what is going on within the process. </p>
 </ol>
 
 <p> Append a <b>-D</b> option to the suspect command in
-/etc/postfix/master.cf, for example: </p>
+/etc/postfix/<a href="master.5.html">master.cf</a>, for example: </p>
 
 <blockquote>
 <pre>
-/etc/postfix/master.cf:
+/etc/postfix/<a href="master.5.html">master.cf</a>:
     smtp      inet  n       -       n       -       -       smtpd -D
 </pre>
 </blockquote>
 
-<p> Edit the <a href="postconf.5.html#debugger_command">debugger_command</a> definition in /etc/postfix/main.cf
+<p> Edit the <a href="postconf.5.html#debugger_command">debugger_command</a> definition in /etc/postfix/<a href="postconf.5.html">main.cf</a>
 so that it invokes the call tracer of your choice, for example:
 </p>
 
 <blockquote>
 <pre>
-/etc/postfix/main.cf:
+/etc/postfix/<a href="postconf.5.html">main.cf</a>:
     <a href="postconf.5.html#debugger_command">debugger_command</a> =
          PATH=/bin:/usr/bin:/usr/local/bin;
          (truss -p $<a href="postconf.5.html#process_id">process_id</a> 2&gt&amp;1 | logger -p mail.info) &amp; sleep 5
@@ -315,22 +318,22 @@ so that it invokes the call tracer of your choice, for example:
 
 <p> Type "<b>postfix reload</b>" and watch the logfile. </p>
 
-<h2><a name="xxgdb">Running daemon programs with the interactive
-xxgdb debugger</a></h2>
+<h2><a name="ddd">Running daemon programs with the interactive
+ddd debugger</a></h2>
 
 <p> If you have X Windows installed on the Postfix machine, then
-an interactive debugger such as <b>xxgdb</b> can be convenient.
+an interactive debugger such as <b>ddd</b> can be convenient.
 </p>
 
-<p> Edit the <a href="postconf.5.html#debugger_command">debugger_command</a> definition in /etc/postfix/main.cf
-so that it invokes <b>xxgdb</b>: </p>
+<p> Edit the <a href="postconf.5.html#debugger_command">debugger_command</a> definition in /etc/postfix/<a href="postconf.5.html">main.cf</a>
+so that it invokes <b>ddd</b>: </p>
 
 <blockquote>
 <pre>
-/etc/postfix/main.cf:
+/etc/postfix/<a href="postconf.5.html">main.cf</a>:
     <a href="postconf.5.html#debugger_command">debugger_command</a> =
          PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
-         xxgdb $<a href="postconf.5.html#daemon_directory">daemon_directory</a>/$<a href="postconf.5.html#process_name">process_name</a> $<a href="postconf.5.html#process_id">process_id</a> &amp; sleep 5
+         ddd $<a href="postconf.5.html#daemon_directory">daemon_directory</a>/$<a href="postconf.5.html#process_name">process_name</a> $<a href="postconf.5.html#process_id">process_id</a> &amp; sleep 5
 </pre>
 </blockquote>
 
@@ -346,11 +349,11 @@ $ <b>export XAUTHORITY=$HOME/.Xauthority</b> (sh syntax)
 </blockquote>
 
 <p> Append a <b>-D</b> option to the suspect daemon definition in
-/etc/postfix/master.cf, for example: </p>
+/etc/postfix/<a href="master.5.html">master.cf</a>, for example: </p>
 
 <blockquote>
 <pre>
-/etc/postfix/master.cf:
+/etc/postfix/<a href="master.5.html">master.cf</a>:
     smtp      inet  n       -       n       -       -       smtpd -D
 </pre>
 </blockquote>
@@ -362,6 +365,52 @@ settings. </p>
 <p> Whenever the suspect daemon process is started, a debugger
 window pops up and you can watch in detail what happens. </p>
 
+<h2><a name="screen">Running daemon programs with the interactive
+gdb debugger</a></h2>
+
+<p> If you have the screen command installed on the Postfix machine, then
+you can run an interactive debugger such as <b>gdb</b> as follows. </p>
+
+<p> Edit the <a href="postconf.5.html#debugger_command">debugger_command</a> definition in /etc/postfix/<a href="postconf.5.html">main.cf</a>
+so that it runs <b>gdb</b> inside a detached <b>screen</b> session:
+</p>
+
+<blockquote>
+<pre>
+/etc/postfix/<a href="postconf.5.html">main.cf</a>:
+    <a href="postconf.5.html#debugger_command">debugger_command</a> =
+        PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; HOME=/root;
+        export HOME; screen -e^tt -dmS $<a href="postconf.5.html#process_name">process_name</a> gdb
+        $<a href="postconf.5.html#daemon_directory">daemon_directory</a>/$<a href="postconf.5.html#process_name">process_name</a> $<a href="postconf.5.html#process_id">process_id</a> &amp; sleep 2
+</pre>
+</blockquote>
+
+<p> Be sure that <b>gdb</b> is in the command search path. </p>
+
+<p> Append a <b>-D</b> option to the suspect daemon definition in
+/etc/postfix/<a href="master.5.html">master.cf</a>, for example: </p>
+
+<blockquote>
+<pre>
+/etc/postfix/<a href="master.5.html">master.cf</a>:
+    smtp      inet  n       -       n       -       -       smtpd -D
+</pre>
+</blockquote>
+
+<p> Execute the command "<b>postfix reload</b>" and wait until a
+daemon process is started (you can see this in the maillog file).
+</p>
+
+<p> Then attach to the screen, and debug away: </p>
+
+<blockquote>
+<pre>
+# HOME=/root screen -r
+gdb) continue
+gdb) where
+</pre>
+</blockquote>
+
 <h2><a name="gdb">Running daemon programs under a non-interactive
 debugger</a></h2>
 
@@ -370,12 +419,12 @@ or if you are not familiar with interactive debuggers, then you
 can try to run <b>gdb</b> in non-interactive mode, and have it
 print a stack trace when the process crashes.  </p>
 
-<p> Edit the <a href="postconf.5.html#debugger_command">debugger_command</a> definition in /etc/postfix/main.cf
+<p> Edit the <a href="postconf.5.html#debugger_command">debugger_command</a> definition in /etc/postfix/<a href="postconf.5.html">main.cf</a>
 so that it invokes the <b>gdb</b> debugger: </p>
 
 <blockquote>
 <pre>
-/etc/postfix/main.cf:
+/etc/postfix/<a href="postconf.5.html">main.cf</a>:
     <a href="postconf.5.html#debugger_command">debugger_command</a> =
         PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont; echo
         where; sleep 8640000) | gdb $<a href="postconf.5.html#daemon_directory">daemon_directory</a>/$<a href="postconf.5.html#process_name">process_name</a> 
@@ -385,11 +434,11 @@ so that it invokes the <b>gdb</b> debugger: </p>
 </blockquote>
 
 <p> Append a <b>-D</b> option to the suspect daemon in
-/etc/postfix/master.cf, for example: </p>
+/etc/postfix/<a href="master.5.html">master.cf</a>, for example: </p>
 
 <blockquote>
 <pre>
-/etc/postfix/master.cf:
+/etc/postfix/<a href="master.5.html">master.cf</a>:
     smtp      inet  n       -       n       -       -       smtpd -D
 </pre>
 </blockquote>
@@ -500,7 +549,7 @@ by "D" so that the helpers can still recognize syntactical errors.
 </p>
 
 <li> <p> Output from "<b>postconf -n</b>". Please do not send your
-main.cf file or 400+ lines of <b>postconf</b> output. </p>
+<a href="postconf.5.html">main.cf</a> file or 400+ lines of <b>postconf</b> output. </p>
 
 <li> <p>  Better, provide output from the <b>postfinger</b> tool.
 This can be found at <a href="http://ftp.wl0.org/SOURCES/postfinger">http://ftp.wl0.org/SOURCES/postfinger</a>.  </p>
index 77702414674eb503a9445c6b252304e07d5e3d5c..22f7c23fbaf4bec272d52e189189ae63352f4148 100644 (file)
@@ -25,9 +25,6 @@ MAN2HTML = man2html -t "Postfix manual - `IFS=.; set \`echo $@\`; echo \"$$1($$2
 
 update:        $(DAEMONS) $(COMMANDS) $(CONFIG) $(OTHER)
 
-Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../src/makedefs; cat $?) >$@
-
 clean:
        echo clean
 
index 2c5304b8166281a180bad607c36056abdf6f4210..49ac96961577f909359b00908bbf0c28872f1bda 100644 (file)
@@ -4837,7 +4837,8 @@ Examples:
 <p>
 The maximum amount of time that an idle Postfix daemon process
 waits for the next service request before exiting.  This parameter
-is ignored by the Postfix queue manager.
+is ignored by the Postfix queue manager and by other long-lived
+Postfix daemon processes.
 </p>
 
 <p>
@@ -6751,7 +6752,7 @@ Example:
 (default: empty)</b></DT><DD>
 
 <p> A sender-dependent override for the global <a href="postconf.5.html#relayhost">relayhost</a> parameter
-setting. The tables are searched by the sender address and by the
+setting. The tables are searched by the envelope sender address and
 @domain. This information is overruled with <a href="postconf.5.html#relay_transport">relay_transport</a>,
 <a href="postconf.5.html#default_transport">default_transport</a> and with the <a href="transport.5.html">transport(5)</a> table. </p>
 
index 31e948f6ffa152fa032934823743994b256910ef..7ff2e3471441ac08b540db39a1df8019b128b378 100644 (file)
@@ -23,9 +23,6 @@ TOOLS = man1/smtp-sink.1 man1/smtp-source.1 man1/qmqp-sink.1 \
 
 update:        $(DAEMONS) $(COMMANDS) $(CONFIG) $(TOOLS)
 
-Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../src/makedefs; cat $?) >$@
-
 clean:
        rm -f cat?/*
 
index 15cc3134fd0dd22db71ee612594435b7f6060eaa..688476ed8a1edfd574ea796caffea6e0bdbc9209 100644 (file)
@@ -2627,7 +2627,8 @@ masquerade_exceptions = root
 .SH max_idle (default: 100s)
 The maximum amount of time that an idle Postfix daemon process
 waits for the next service request before exiting.  This parameter
-is ignored by the Postfix queue manager.
+is ignored by the Postfix queue manager and by other long-lived
+Postfix daemon processes.
 .PP
 Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks).
 The default time unit is s (seconds).
@@ -3750,7 +3751,7 @@ sender_canonical_maps = hash:/etc/postfix/sender_canonical
 .ft R
 .SH sender_dependent_relayhost_maps (default: empty)
 A sender-dependent override for the global relayhost parameter
-setting. The tables are searched by the sender address and by the
+setting. The tables are searched by the envelope sender address and
 @domain. This information is overruled with relay_transport,
 default_transport and with the \fBtransport\fR(5) table.
 .PP
index 76c78e0cb492bfa7b0f4ddbbb9ba9437cd433276..21895ae5ec66d12b0dd62158b7e647b7ff8c1dd3 100644 (file)
@@ -1174,13 +1174,13 @@ to mailbox, or delivery to non-Postfix command. </p>
 Content-Description: Notification
 Content-Type: text/plain
 
-This is the Postfix program at host spike.porcupine.org.
+This is the mail system at host spike.porcupine.org.
 
 Enclosed is the mail delivery report that you requested.
 
-                        The Postfix program
+                        The mail system
 
-&lt;postfix-users@postfix.org&gt;: delivery via mail.cloud9.net[168.100.1.4]: 250 Ok
+&lt;postfix-users@postfix.org&gt;: delivery via mail.cloud9.net[168.100.1.4]: 250 2.1.5 Ok
 </pre>
 </blockquote>
 
@@ -1210,13 +1210,13 @@ Content-Type: message/delivery-status
 Reporting-MTA: dns; spike.porcupine.org
 X-Postfix-Queue-ID: 84863BC0E5
 X-Postfix-Sender: rfc822; wietse@porcupine.org
-Arrival-Date: Tue, 13 Apr 2004 19:27:43 -0400 (EDT)
+Arrival-Date: Sun, 26 Nov 2006 17:01:01 -0500 (EST)
 
 Final-Recipient: rfc822; postfix-users@postfix.org
 Action: deliverable
-Status: 2.0.0
+Status: 2.1.5
 Remote-MTA: dns; mail.cloud9.net
-Diagnostic-Code: smtp; 250 Ok
+Diagnostic-Code: smtp; 250 2.1.5 Ok
 </pre>
 </blockquote>
 
@@ -1232,11 +1232,11 @@ Content-Description: Message
 Content-Type: message/rfc822
 
 Received: by spike.porcupine.org (Postfix, from userid 1001)
-        id 84863BC0E5; Tue, 13 Apr 2004 19:27:43 -0400 (EDT)
+        id 84863BC0E5; id DA77DBC0A9; Sun, 26 Nov 2006 17:01:01 -0500 (EST)
 Subject: probe
 To: postfix-users@postfix.org
-Message-Id: &lt;20040413232743.84863BC0E5@spike.porcupine.org&gt;
-Date: Tue, 13 Apr 2004 19:27:43 -0400 (EDT)
+Message-Id: &lt;20061126220101.84863BC0E5@spike.porcupine.org&gt;
+Date: Sun, 26 Nov 2006 17:01:01 -0500 (EST)
 From: wietse@porcupine.org (Wietse Venema)
 </pre>
 </blockquote>
index 1b9a7864e87410251439b12fddbed3710a1bf980..4c7dd3677c973af43bc8d2d8fd6ec11b73797de3 100644 (file)
@@ -38,7 +38,7 @@ recipient addresses?</a>
 <ul>
 
 <li><a href="#forged_helo">Blocking backscatter mail with forged
-HELO information</a>
+mail server information</a>
 
 <li><a href="#forged_sender">Blocking backscatter mail with forged
 sender information</a>
@@ -91,7 +91,7 @@ information that you can use to recognize and block forged mail.
 </p>
 
 <h3><a name="forged_helo">Blocking backscatter mail with forged
-HELO information</a></h3>
+mail server information</a></h3>
 
 <p> Although my email address is "wietse@porcupine.org", all my
 mail systems announce themselves with the SMTP HELO command as
@@ -127,6 +127,18 @@ Received: from host.example.com (EHLO porcupine.org) ...
 </pre>
 </blockquote>
 
+<p> Some forgeries show up in the way that a mail server reports
+itself in Received: message headers. Keeping in mind that all my
+systems have a mail server name of <i>hostname</i>.porcupine.org,
+the following is definitely a forgery:</p>
+
+<blockquote>
+<pre>
+Received: by porcupine.org ...
+Received: from host.example.com ( ... ) by porcupine.org ...
+</pre>
+</blockquote>
+
 <p> Another frequent sign of forgery is the Message-ID: header. My
 systems produce a Message-ID: of
 &lt;<i>stuff</i>@<i>hostname</i>.porcupine.org&gt;.  The following
@@ -149,18 +161,26 @@ patterns like this: </p>
     body_checks = regexp:/etc/postfix/body_checks
 
 /etc/postfix/header_checks:
+    if /^Received:/
     /^Received: +from +(porcupine\.org) +/
         reject forged client name in Received: header: $1
     /^Received: +from +[^ ]+ +\(([^ ]+ +[he]+lo=|[he]+lo +)(porcupine\.org)\)/
         reject forged client name in Received: header: $2
+    /^Received:.* +by +(porcupine\.org)[[:&gt;:]]/
+        reject forged mail server name in Received: header: $1
+    endif
     /^Message-ID:.*@(porcupine\.org)/
        reject forged domain name in Message-ID: header: $1
 
 /etc/postfix/body_checks:
+    if /^[&gt; ]*Received:/
     /^[&gt; ]*Received: +from +(porcupine\.org) /
         reject forged client name in Received: header: $1
     /^[&gt; ]*Received: +from +[^ ]+ +\(([^ ]+ +[he]+lo=|[he]+lo +)(porcupine\.org)\)/
         reject forged client name in Received: header: $2
+    /^[&gt; ]*Received:.* +by +(porcupine\.org)[[:&gt;:]]/
+        reject forged mail server name in Received: header: $1
+    endif
     /^[&gt; ]*Message-ID:.*@(porcupine\.org)/
        reject forged domain name in Message-ID: header: $1
 </pre>
@@ -181,6 +201,14 @@ the "<tt>\</tt>", the "<tt>.</tt>" would match any character. </p>
 and "<tt>)</tt>" literally. Without the "<tt>\</tt>", the "<tt>(</tt>"
 and "<tt>)</tt>" would be grouping operators.  </p>
 
+<li> <p> The "<tt>[[:&gt;:]]</tt>" matches the end of a word. On
+some systems you should specify "<tt>\&gt;</tt>" instead. For details
+see your system documentation. </p>
+
+<li> <p> The "if /pattern/" and "endif" eliminate unnecessary
+matching attempts. DO NOT indent lines starting with /pattern/
+between the "if" and "endif"! </p>
+
 </ul>
 
 <p><a name="caveats"><strong>Caveats</strong></a></p>
@@ -251,7 +279,7 @@ reality, my patterns list multiple email addresses as
 <li> <p> The "<tt>[[:&lt;:]]</tt>" and "<tt>[[:&gt;:]]</tt>" match
 the beginning and end of a word, respectively. On some systems you
 should specify "<tt>\&lt;</tt>" and "<tt>\&gt;</tt>" instead. For
-details see your system documentation.
+details see your system documentation. </p>
 
 <li> <p> The "<tt>\.</tt>" matches "<tt>.</tt>" literally. Without
 the "<tt>\</tt>", the "<tt>.</tt>" would match any character. </p>
index f663add13263a4aa0227e30410216c5a56c762f0..cdfc09a4b86e679ea7c574e3f803851516a86442 100644 (file)
@@ -54,8 +54,11 @@ sniffer</a>
 <li><a href="#auto_trace">Automatically tracing a Postfix daemon
 process</a>
 
-<li><a href="#xxgdb">Running daemon programs with the interactive
-xxgdb debugger</a>
+<li><a href="#ddd">Running daemon programs with the interactive
+ddd debugger</a>
+
+<li><a href="#screen">Running daemon programs with the interactive
+gdb debugger</a>
 
 <li><a href="#gdb">Running daemon programs under a non-interactive
 debugger</a>
@@ -315,22 +318,22 @@ so that it invokes the call tracer of your choice, for example:
 
 <p> Type "<b>postfix reload</b>" and watch the logfile. </p>
 
-<h2><a name="xxgdb">Running daemon programs with the interactive
-xxgdb debugger</a></h2>
+<h2><a name="ddd">Running daemon programs with the interactive
+ddd debugger</a></h2>
 
 <p> If you have X Windows installed on the Postfix machine, then
-an interactive debugger such as <b>xxgdb</b> can be convenient.
+an interactive debugger such as <b>ddd</b> can be convenient.
 </p>
 
 <p> Edit the debugger_command definition in /etc/postfix/main.cf
-so that it invokes <b>xxgdb</b>: </p>
+so that it invokes <b>ddd</b>: </p>
 
 <blockquote>
 <pre>
 /etc/postfix/main.cf:
     debugger_command =
          PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
-         xxgdb $daemon_directory/$process_name $process_id &amp; sleep 5
+         ddd $daemon_directory/$process_name $process_id &amp; sleep 5
 </pre>
 </blockquote>
 
@@ -362,6 +365,52 @@ settings. </p>
 <p> Whenever the suspect daemon process is started, a debugger
 window pops up and you can watch in detail what happens. </p>
 
+<h2><a name="screen">Running daemon programs with the interactive
+gdb debugger</a></h2>
+
+<p> If you have the screen command installed on the Postfix machine, then
+you can run an interactive debugger such as <b>gdb</b> as follows. </p>
+
+<p> Edit the debugger_command definition in /etc/postfix/main.cf
+so that it runs <b>gdb</b> inside a detached <b>screen</b> session:
+</p>
+
+<blockquote>
+<pre>
+/etc/postfix/main.cf:
+    debugger_command =
+        PATH=/bin:/usr/bin:/sbin:/usr/sbin; export PATH; HOME=/root;
+        export HOME; screen -e^tt -dmS $process_name gdb
+        $daemon_directory/$process_name $process_id &amp; sleep 2
+</pre>
+</blockquote>
+
+<p> Be sure that <b>gdb</b> is in the command search path. </p>
+
+<p> Append a <b>-D</b> option to the suspect daemon definition in
+/etc/postfix/master.cf, for example: </p>
+
+<blockquote>
+<pre>
+/etc/postfix/master.cf:
+    smtp      inet  n       -       n       -       -       smtpd -D
+</pre>
+</blockquote>
+
+<p> Execute the command "<b>postfix reload</b>" and wait until a
+daemon process is started (you can see this in the maillog file).
+</p>
+
+<p> Then attach to the screen, and debug away: </p>
+
+<blockquote>
+<pre>
+# HOME=/root screen -r
+gdb) continue
+gdb) where
+</pre>
+</blockquote>
+
 <h2><a name="gdb">Running daemon programs under a non-interactive
 debugger</a></h2>
 
index b8814aff77566c46c6d0ba7a3d841f99dcdc1ba4..b76c8dc043a75deb28bc05373aeb35e0cab7ba46 100644 (file)
@@ -88,9 +88,6 @@ MAKEAAA       = ../mantools/makereadme
 
 update:        $(CONFIG) $(HTML) $(README) $(MAN)
 
-Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../makedefs; cat $?) >$@
-
 clean:
        :
 
index 5dbcfa348838cf3fdabef63e1082c661f801cf54..67f86b46fa05d30070dfc48981d8eee924aeb027 100644 (file)
@@ -2543,7 +2543,8 @@ masquerade_exceptions = root
 <p>
 The maximum amount of time that an idle Postfix daemon process
 waits for the next service request before exiting.  This parameter
-is ignored by the Postfix queue manager.
+is ignored by the Postfix queue manager and by other long-lived
+Postfix daemon processes.
 </p>
 
 <p>
@@ -8998,7 +8999,7 @@ is placed into the Postfix configuration directory.  </p>
 %PARAM sender_dependent_relayhost_maps empty
 
 <p> A sender-dependent override for the global relayhost parameter
-setting. The tables are searched by the sender address and by the
+setting. The tables are searched by the envelope sender address and
 @domain. This information is overruled with relay_transport,
 default_transport and with the transport(5) table. </p>
 
index 3a40defa900ff727ac8faea7b70072960d9f02b1..62946461e1392ddf838b0f114708d5ff79f68e9f 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 2916a25c2f82b10f0ae80887d5c9f377d5ce4dfd..ddfaaa2eb0a91aca5014e5df667efbf2df8b3a75 100644 (file)
@@ -36,7 +36,7 @@ main.cf:
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 843e94dbc2eee526ef9fb087ad394de42d03688d..2b1993750cc20b11375f40d59bcd4cdf715436b2 100644 (file)
@@ -27,7 +27,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 5af24c59c636d8cd45032fdea34ba6b8115e8d73..5e71c8b8963975a81af2d8361101d504e5974d21 100644 (file)
@@ -596,6 +596,16 @@ static void cleanup_header_done_callback(void *context)
     TOK822 *token;
     time_t  tv;
 
+    /*
+     * XXX Workaround: when we reach the end of headers, mime_state_update()
+     * may execute up to three call-backs before returning to the caller:
+     * head_out(), head_end(), and body_out() or body_end(). As long as
+     * call-backs don't return a result, each call-back has to check for
+     * itself if the previous call-back experienced a problem.
+     */
+    if (CLEANUP_OUT_OK(state) == 0)
+       return;
+
     /*
      * Add a missing (Resent-)Message-Id: header. The message ID gives the
      * time in GMT units, plus the local queue ID.
@@ -706,6 +716,16 @@ static void cleanup_body_callback(void *context, int type,
 {
     CLEANUP_STATE *state = (CLEANUP_STATE *) context;
 
+    /*
+     * XXX Workaround: when we reach the end of headers, mime_state_update()
+     * may execute up to three call-backs before returning to the caller:
+     * head_out(), head_end(), and body_out() or body_end(). As long as
+     * call-backs don't return a result, each call-back has to check for
+     * itself if the previous call-back experienced a problem.
+     */
+    if (CLEANUP_OUT_OK(state) == 0)
+       return;
+
     /*
      * Crude message body content filter for emergencies. This code has
      * several problems: it sees one line at a time; it looks at long lines
@@ -892,6 +912,15 @@ void    cleanup_message(CLEANUP_STATE *state, int type, const char *buf, ssize_t
                                         cleanup_mime_error_callback,
                                         (void *) state);
 
+    /*
+     * XXX Workaround: truncate a long message header so that we don't exceed
+     * the Milter request size limit of 65535.
+     */
+#define KLUDGE_HEADER_LIMIT    60000
+    if ((cleanup_milters || state->milters)
+       && var_header_limit > KLUDGE_HEADER_LIMIT)
+       var_header_limit = KLUDGE_HEADER_LIMIT;
+
     /*
      * Pass control to the header processing routine.
      */
index 87a0795774e322e77ff4f1dabc52fba96168ba41..5836159c4037a7e0585dac82f52af6d72c453aaf 100644 (file)
@@ -1805,6 +1805,7 @@ int     main(int unused_argc, char **argv)
 
     msg_vstream_init(argv[0], VSTREAM_ERR);
     var_line_limit = DEF_LINE_LIMIT;
+    var_header_limit = DEF_HEADER_LIMIT;
 
     for (;;) {
        ARGV   *argv;
index c816373727da144e7e425f659865e5b77643588a..52d3211fbac6da608a24e452ece4795575fc98cd 100644 (file)
@@ -175,9 +175,22 @@ void    cleanup_out_header(CLEANUP_STATE *state, VSTRING *header_buf)
      * of such header lines. NB: This code destroys the header. We could try
      * to avoid clobbering it, but we're not going to use the data any
      * further.
+     * 
+     * XXX We prefer to truncate a header at the last line boundary before the
+     * header size limit. If this would undershoot the limit by more than
+     * 10%, we truncate between line boundaries to avoid losing too much
+     * text. This "unkind cut" may result in syntax errors and may trigger
+     * warnings from down-stream MTAs.
      */
     for (line = start; line; line = next_line) {
        next_line = split_at(line, '\n');
+       if ((next_line ? next_line - 1 : line + strlen(line))
+           > start + var_header_limit) {
+           if (line - start > 0.9 * var_header_limit)  /* nice cut */
+               break;
+           start[var_header_limit] = 0;        /* unkind cut */
+           next_line = 0;
+       }
        if (line == start || IS_SPACE_TAB(*line)) {
            cleanup_out_string(state, REC_TYPE_NORM, line);
        } else {
index df547859466bf17131da6b17de540ee9532253e6..e39100098059f4b4e75a101ca492a61e682a40e6 100644 (file)
@@ -18,7 +18,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 2ed6fd65dda63b0b071cfdad01c96c90bac39a27..bbc5e9884b3074208197fb644d50458bc426aff6 100644 (file)
@@ -21,7 +21,7 @@ all: $(LIB)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 86f6a40d3e022a3b9f3b7f43e8fccd4fb4a2eeaa..84ececa7ec6de69dbad64e161461e82641d52408 100644 (file)
@@ -18,7 +18,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index c6d309bc9b3c035b521b02e398aaa90430b201a0..b83c38529315c6355764fdacba0eff71b0ffb4dc 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index a390e794e56e83df1010d7865f92d9b0b5e2fdb0..098b141ea06626b805871d5fa8f97bea98006f3d 100644 (file)
@@ -17,7 +17,7 @@ all:  $(PROG)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 fsstone: fsstone.o $(LIBS)
        $(CC) $(CFLAGS) -o $@ fsstone.o $(LIBS) $(SYSLIBS)
index ab9162360a81f4ba6875454feee0f9bb246b7488..778e3c5c1fa80c6cf7bd0daa15ee2314db12639a 100644 (file)
@@ -105,7 +105,7 @@ all: $(LIB)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 5ce496af76d2845c6e9be213dae578b3a142c9e9..b8da5abcebc32d9accf3c53a81ec45fa2610c8c5 100644 (file)
@@ -90,6 +90,7 @@ static const char *dict_proxy_lookup(DICT *dict, const char *key)
     DICT_PROXY *dict_proxy = (DICT_PROXY *) dict;
     VSTREAM *stream;
     int     status;
+    int     count = 0;
 
     /*
      * The client and server live in separate processes that may start and
@@ -103,6 +104,7 @@ static const char *dict_proxy_lookup(DICT *dict, const char *key)
     for (;;) {
        stream = clnt_stream_access(proxy_stream);
        errno = 0;
+       count += 1;
        if (attr_print(stream, ATTR_FLAG_NONE,
                       ATTR_TYPE_STR, MAIL_ATTR_REQ, PROXY_REQ_LOOKUP,
                       ATTR_TYPE_STR, MAIL_ATTR_TABLE, dict->name,
@@ -114,7 +116,7 @@ static const char *dict_proxy_lookup(DICT *dict, const char *key)
                         ATTR_TYPE_INT, MAIL_ATTR_STATUS, &status,
                         ATTR_TYPE_STR, MAIL_ATTR_VALUE, dict_proxy->result,
                         ATTR_TYPE_END) != 2) {
-           if (msg_verbose || (errno != EPIPE && errno != ENOENT))
+           if (msg_verbose || count > 1 || (errno && errno != EPIPE && errno != ENOENT))
                msg_warn("%s: service %s: %m", myname, VSTREAM_PATH(stream));
        } else {
            if (msg_verbose)
index 7efa772c403955d21b41b5ba57d1aacc8a045e32..50368ed845b2bb21f8dadfb7ee9edfafa17f5f77 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20061019"
+#define MAIL_RELEASE_DATE      "20061201"
 #define MAIL_VERSION_NUMBER    "2.4"
 
 #ifdef SNAPSHOT
index 66b93fb7ad381cafa83551e3cd0eb091ceeb91e5..7e7f162dd810da7e61a6f47c48e1c58c7c5e83db 100644 (file)
 /* .IP state
 /*     MIME parser state created with mime_state_alloc().
 /* BUGS
+/*     NOTE: when the end of headers is reached, mime_state_update()
+/*     may execute up to three call-backs before returning to the
+/*     caller: head_out(), head_end(), and body_out() or body_end().
+/*     As long as call-backs return no result, it is up to the
+/*     call-back routines to check if a previous call-back experienced
+/*     an error.
+/*
 /*     Different mail user agents treat malformed message boundary
 /*     strings in different ways. The Postfix MIME processor cannot
 /*     be bug-compatible with everything.
index 1b9ae4e8d87e6ba59f835d6b83b5fb3947a1aec7..b96f0a736bfbf575803ce3c98c216ddf6a34b340 100644 (file)
@@ -164,6 +164,7 @@ void    resolve_clnt(const char *class, const char *sender,
     const char *myname = "resolve_clnt";
     VSTREAM *stream;
     int     server_flags;
+    int     count = 0;
 
     /*
      * One-entry cache.
@@ -226,6 +227,7 @@ void    resolve_clnt(const char *class, const char *sender,
     for (;;) {
        stream = clnt_stream_access(rewrite_clnt_stream);
        errno = 0;
+       count += 1;
        if (attr_print(stream, ATTR_FLAG_NONE,
                       ATTR_TYPE_STR, MAIL_ATTR_REQ, class,
                       ATTR_TYPE_STR, MAIL_ATTR_SENDER, sender,
@@ -239,7 +241,7 @@ void    resolve_clnt(const char *class, const char *sender,
                         ATTR_TYPE_STR, MAIL_ATTR_RECIP, reply->recipient,
                         ATTR_TYPE_INT, MAIL_ATTR_FLAGS, &reply->flags,
                         ATTR_TYPE_END) != 5) {
-           if (msg_verbose || (errno != EPIPE && errno != ENOENT))
+           if (msg_verbose || count > 1 || (errno && errno != EPIPE && errno != ENOENT))
                msg_warn("problem talking to service %s: %m",
                         var_rewrite_service);
        } else {
index 601f7ca000fa73aeacaee31a2d51d166d1976f03..8bb3f0a5247967432349fed7cbf7bf851772c3af 100644 (file)
@@ -82,6 +82,7 @@ VSTRING *rewrite_clnt(const char *rule, const char *addr, VSTRING *result)
 {
     VSTREAM *stream;
     int     server_flags;
+    int     count = 0;
 
     /*
      * One-entry cache.
@@ -129,6 +130,7 @@ VSTRING *rewrite_clnt(const char *rule, const char *addr, VSTRING *result)
     for (;;) {
        stream = clnt_stream_access(rewrite_clnt_stream);
        errno = 0;
+       count += 1;
        if (attr_print(stream, ATTR_FLAG_NONE,
                       ATTR_TYPE_STR, MAIL_ATTR_REQ, REWRITE_ADDR,
                       ATTR_TYPE_STR, MAIL_ATTR_RULE, rule,
@@ -139,7 +141,7 @@ VSTRING *rewrite_clnt(const char *rule, const char *addr, VSTRING *result)
                         ATTR_TYPE_INT, MAIL_ATTR_FLAGS, &server_flags,
                         ATTR_TYPE_STR, MAIL_ATTR_ADDR, result,
                         ATTR_TYPE_END) != 2) {
-           if (msg_verbose || (errno != EPIPE && errno != ENOENT))
+           if (msg_verbose || count > 1 || (errno && errno != EPIPE && errno != ENOENT))
                msg_warn("problem talking to service %s: %m",
                         var_rewrite_service);
        } else {
index 10573e7df1d88b1e4bc17f087c7a7fbc9222f06f..658e88f75b521a631ef4eb6e573c92222dd4e19d 100644 (file)
@@ -91,6 +91,7 @@ static void scache_clnt_save_endp(SCACHE *scache, int endp_ttl,
     VSTREAM *stream;
     int     status;
     int     tries;
+    int     count = 0;
 
     if (msg_verbose)
        msg_info("%s: endp=%s prop=%s fd=%d",
@@ -110,6 +111,7 @@ static void scache_clnt_save_endp(SCACHE *scache, int endp_ttl,
     for (tries = 0; sp->auto_clnt != 0; tries++) {
        if ((stream = auto_clnt_access(sp->auto_clnt)) != 0) {
            errno = 0;
+           count += 1;
            if (attr_print(stream, ATTR_FLAG_NONE,
                         ATTR_TYPE_STR, MAIL_ATTR_REQ, SCACHE_REQ_SAVE_ENDP,
                           ATTR_TYPE_INT, MAIL_ATTR_TTL, endp_ttl,
@@ -126,7 +128,7 @@ static void scache_clnt_save_endp(SCACHE *scache, int endp_ttl,
                || attr_scan(stream, ATTR_FLAG_STRICT,
                             ATTR_TYPE_INT, MAIL_ATTR_STATUS, &status,
                             ATTR_TYPE_END) != 1) {
-               if (msg_verbose || (errno != EPIPE && errno != ENOENT))
+               if (msg_verbose || count > 1 || (errno && errno != EPIPE && errno != ENOENT))
                    msg_warn("problem talking to service %s: %m",
                             VSTREAM_PATH(stream));
                /* Give up or recover. */
@@ -281,7 +283,7 @@ static void scache_clnt_save_dest(SCACHE *scache, int dest_ttl,
                             myname, status);
                break;
            }
-           }
+       }
        /* Give up or recover. */
        if (tries >= SCACHE_MAX_TRIES - 1) {
            msg_warn("disabling connection caching");
index 916cce3fc876d00179cb0fbb7870feeeb6ad0453..7468c1f0c6a12b6d0d40e9dd72fc28ac8b3552b4 100644 (file)
@@ -96,6 +96,7 @@ int     verify_clnt_query(const char *addr, int *addr_status, VSTRING *why)
 {
     VSTREAM *stream;
     int     request_status;
+    int     count = 0;
 
     /*
      * Do client-server plumbing.
@@ -109,6 +110,7 @@ int     verify_clnt_query(const char *addr, int *addr_status, VSTRING *why)
     for (;;) {
        stream = clnt_stream_access(vrfy_clnt);
        errno = 0;
+       count += 1;
        if (attr_print(stream, ATTR_FLAG_NONE,
                       ATTR_TYPE_STR, MAIL_ATTR_REQ, VRFY_REQ_QUERY,
                       ATTR_TYPE_STR, MAIL_ATTR_ADDR, addr,
@@ -119,7 +121,7 @@ int     verify_clnt_query(const char *addr, int *addr_status, VSTRING *why)
                         ATTR_TYPE_INT, MAIL_ATTR_ADDR_STATUS, addr_status,
                         ATTR_TYPE_STR, MAIL_ATTR_WHY, why,
                         ATTR_TYPE_END) != 3) {
-           if (msg_verbose || (errno != EPIPE && errno != ENOENT))
+           if (msg_verbose || count > 1 || (errno && errno != EPIPE && errno != ENOENT))
                msg_warn("problem talking to service %s: %m",
                         var_verify_service);
        } else {
index 486f206e7692e1da830189529e710401d35b6fa9..bd9814b5f7d0a63b1a4322faa10bf67a20feffd2 100644 (file)
@@ -24,7 +24,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index ba4658c9c26375b17f0c94c5c0033395d55c65d9..2138f0a485822fe17c500ca7d59b52225739e95d 100644 (file)
@@ -27,7 +27,7 @@ all:  $(PROG) $(LIB)
 $(OBJS) $(LIB_OBJ): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 $(PROG): $(OBJS) $(LIBS)
        $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) $(SYSLIBS)
index fb507c9cfa0ba7ee34dddc22354817498e793966..4b10cda9b947c57663bcace7af15571150246e06 100644 (file)
@@ -21,7 +21,7 @@ all: $(LIB)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 2fe60af83d89a4f5e9fdb10e8b99ab9583e50de4..f5ac7240aff38bc80396716b71d88c58d52ce4dd 100644 (file)
@@ -877,6 +877,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
                                         int skip_reply,
                                         ARGV *macros,...)
 {
+    const char *myname = "milter8_event";
     va_list ap;
     ssize_t data_len;
     int     err;
@@ -890,6 +891,17 @@ static const char *milter8_event(MILTER8 *milter, int event,
 
 #define DONT_SKIP_REPLY        0
 
+    /*
+     * Sanity check.
+     */
+    if (milter->fp == 0 || milter->def_reply != 0) {
+       msg_warn("%s: attempt to send event %s to milter %s after error",
+                myname,
+                (smfic_name = str_name_code(smfic_table, event)) != 0 ?
+                smfic_name : "(unknown MTA event)", milter->m.name);
+       return (milter->def_reply);
+    }
+
     /*
      * Skip this event if it doesn't exist in the protocol that I announced.
      */
@@ -1204,7 +1216,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
                                                       (ssize_t) index,
                                                       STR(milter->buf));
                    if (edit_resp)
-                       return (milter8_def_reply(milter, edit_resp));
+                       return (edit_resp);
                    continue;
 #endif
 
@@ -1222,7 +1234,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
                                                   STR(milter->buf),
                                                   STR(milter->body));
                    if (edit_resp)
-                       return (milter8_def_reply(milter, edit_resp));
+                       return (edit_resp);
                    continue;
 
                    /*
@@ -1251,7 +1263,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
                                                   STR(milter->buf),
                                                   STR(milter->body));
                    if (edit_resp)
-                       return (milter8_def_reply(milter, edit_resp));
+                       return (edit_resp);
                    continue;
 #endif
 
@@ -1267,7 +1279,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
                    edit_resp = parent->add_rcpt(parent->chg_context,
                                                 STR(milter->buf));
                    if (edit_resp)
-                       return (milter8_def_reply(milter, edit_resp));
+                       return (edit_resp);
                    continue;
 
                    /*
@@ -1282,7 +1294,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
                    edit_resp = parent->del_rcpt(parent->chg_context,
                                                 STR(milter->buf));
                    if (edit_resp)
-                       return (milter8_def_reply(milter, edit_resp));
+                       return (edit_resp);
                    continue;
 
                    /*
@@ -1299,7 +1311,7 @@ static const char *milter8_event(MILTER8 *milter, int event,
                    edit_resp = parent->repl_body(parent->chg_context,
                                                  milter->body);
                    if (edit_resp)
-                       return (milter8_def_reply(milter, edit_resp));
+                       return (edit_resp);
                    continue;
 #endif
                }
@@ -1946,6 +1958,16 @@ static void milter8_header(void *ptr, int unused_header_class,
     char   *cp;
     int     skip_reply;
 
+    /*
+     * XXX Workaround: mime_state_update() may invoke multiple call-backs
+     * before returning to the caller.
+     */
+#define MILTER8_MESSAGE_DONE(milter, msg_ctx) \
+       ((milter)->state != MILTER8_STAT_MESSAGE || (msg_ctx)->resp != 0)
+
+    if (MILTER8_MESSAGE_DONE(milter, msg_ctx))
+       return;
+
     /*
      * XXX Sendmail compatibility. Don't expose our first (received) header
      * to mail filter applications. See also cleanup_milter.c for code to
@@ -2009,6 +2031,8 @@ static void milter8_eoh(void *ptr)
     MILTER_MSG_CONTEXT *msg_ctx = (MILTER_MSG_CONTEXT *) ptr;
     MILTER8 *milter = msg_ctx->milter;
 
+    if (MILTER8_MESSAGE_DONE(milter, msg_ctx))
+       return;
     if (msg_verbose)
        msg_info("%s: eoh milter %s", myname, milter->m.name);
     msg_ctx->resp =
@@ -2031,6 +2055,9 @@ static void milter8_body(void *ptr, int rec_type,
     ssize_t space;
     ssize_t count;
 
+    if (MILTER8_MESSAGE_DONE(milter, msg_ctx))
+       return;
+
     /*
      * XXX Sendmail compatibility: don't expose our first body line.
      */
@@ -2098,6 +2125,8 @@ static void milter8_eob(void *ptr)
     MILTER_MSG_CONTEXT *msg_ctx = (MILTER_MSG_CONTEXT *) ptr;
     MILTER8 *milter = msg_ctx->milter;
 
+    if (MILTER8_MESSAGE_DONE(milter, msg_ctx))
+       return;
     if (msg_verbose)
        msg_info("%s: eob milter %s", myname, milter->m.name);
     msg_ctx->resp =
@@ -2183,9 +2212,7 @@ static const char *milter8_message(MILTER *m, VSTREAM *qfile,
                msg_ctx.resp = "450 4.3.0 Queue file write error";
                break;
            }
-           if (msg_ctx.resp != 0)
-               break;
-           if (milter->state != MILTER8_STAT_MESSAGE)
+           if (MILTER8_MESSAGE_DONE(milter, &msg_ctx))
                break;
            if (rec_type != REC_TYPE_NORM && rec_type != REC_TYPE_CONT)
                break;
index f3937eb566563640324d4374ff7ca919e43cd77c..1420a87e53a87b988331b66a0dbfc0977053a159 100644 (file)
@@ -22,7 +22,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 3783a61f1b6429979c3069929ccd100016188b3c..ccffdb0b080c985282e2e961c31555d8eedcffec 100644 (file)
@@ -237,7 +237,7 @@ void    qmgr_entry_done(QMGR_ENTRY *entry, int which)
 #define FUDGE(x)       ((x) * (var_qmgr_fudge / 100.0))
     message->refcount--;
     if (message->rcpt_offset > 0
-       && qmgr_recipient_count < FUDGE(var_qmgr_rcpt_limit))
+       && qmgr_recipient_count < FUDGE(var_qmgr_rcpt_limit) - 100)
        qmgr_message_realloc(message);
     if (message->refcount == 0)
        qmgr_active_done(message);
index ca118fcf677963ddda70ae8a0d2f7b65e4c13019..f416e3cb14529481833438ac3f14a2f181f4f40f 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 1e10bd08fbc0f52fd9f6ea0471a58e7ed8c674af..f4e28667034400ef07fa46dce735e04499d1c62f 100644 (file)
@@ -18,7 +18,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index a60ec68062cbdbf665690ffb49c9764efd53be82..109dd6f7122f3814eedf5a01d30be0da42da1df1 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 update: ../../bin/$(PROG)
 
index 04be39e01a7d04f99d7809f6417b99188cce6713..e92b6b71fa7dcc2a597d376fe4be20627b50caa4 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index e721b8db286826be0a06edbb6b826c2e7849d094..3002e2cf2ccc790212f25eb790b89dd0873b51e8 100644 (file)
@@ -28,7 +28,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index fead147a3e2425b1a0bde0bfd6b2d3a7d1ca6c43..178b14ba93eba9aace7911f4cfcc711d7ef6d355 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 543a684c776fad206a83cba8fa98c22a05edb1eb..f61f6703d87a4db4a1693be5fbbcdd7c6a7182a4 100644 (file)
@@ -19,7 +19,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 261d6d080e0388b62d7673da6a0a0717c7ac50c8..527598be8b773069cdb610d1fa21a6c42faaef53 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index d46df3e14be39fbf0c1e35a4221b650bdb77337d..b97c2b9d40cf7d786cc3e629d5508f7e3619617e 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 65029b7951bd3ab12e7e4745c2c176410247e3bd..d0e135930f0e1fe70ab5801d85fd28ba3ae73984 100644 (file)
@@ -19,7 +19,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 3acf6f2db098434725d898698b4a75b172b5c51b..a71a34f848c412a38270c21f1b3d7d902db50bb3 100644 (file)
@@ -18,7 +18,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 update: ../../bin/$(PROG)
 
index f9b06cb933f285f12795e9fbc14974ecf9d4f32f..51894330c2d08f347d1431730235c76c6fc0ab51 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 6200c3a5bed4440ede8129fc5d9d06a187b87547..b131fe88bd13c789bf29c4aaf1d2aa645e5fd07d 100644 (file)
@@ -18,7 +18,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 4d84aa6da5fb6158a98edb7b2bb02151a5109ad9..565afbf6d4c73b920874425919966c524f8e976c 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index f4b3dff9f05771cf84b21d395eef33246a7b15fd..0f5489ebebe6811f57551add0e7c754657e71d8e 100644 (file)
@@ -24,7 +24,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 30365f6a8192d8508ec91bb9133c6ffa7a2297c3..cc86d0b464d4c040fc3d398f61e30976a5385522 100644 (file)
@@ -763,6 +763,16 @@ static QMGR_PEER *qmgr_job_peer_select(QMGR_JOB *job)
     QMGR_PEER *peer;
     QMGR_MESSAGE *message = job->message;
 
+    /*
+     * Workaround to prevent queue manager starvation until the last slow
+     * batch of multi-recipient mail is finished. Postfix 2.4 has a final
+     * solution, but that involves major changes.
+     */
+    if (message->rcpt_offset != 0
+       && message->rcpt_limit > message->rcpt_count - 100
+       && message->refcount > 0) {
+       qmgr_message_realloc(message);
+    }
     if (HAS_ENTRIES(job) && (peer = qmgr_peer_select(job)) != 0)
        return (peer);
 
index aa71e190772c694088145a43d164ceb82581da44..dcb796df0251dc0740fe863b04099a48dd353cb2 100644 (file)
@@ -361,6 +361,9 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
        if (recipient_limit < message->rcpt_limit)
            recipient_limit = message->rcpt_limit;
     }
+    /* Keep interrupt latency in check. */
+    if (recipient_limit > 5000)
+       recipient_limit = 5000;
     if (recipient_limit <= 0)
        msg_panic("%s: no recipient slots available", message->queue_id);
 
index 8b54f7e242f17d315af49a0b8a3e91c966128a63..84c5523b8ad53cb0602dcfa9c0ef61aef1e9d6f8 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 8060c9c933fc914f5fb6493e31e78118a6c96367..e5282e84fbfcba7ce0b640a72216595cd96621ce 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 27be129d740eb027742608c4fe7fc3547d1c59b0..cf9dbeeaa8561de5286a491c539749a2ca7662d4 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index df28b058394c3664cc1e208fb76c1281a95e86cc..2783e970089275f8ac9a7f3b6b391da6ccf34153 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index dad89aae9ed4cfc715b3af0dac583faf0baebd08..9b10ef2513e2407fb7946a9111f01e1b74858309 100644 (file)
@@ -23,7 +23,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 69ac49e33db0b595e3acd6318000436e8d6dd456..a7a3e9c5d2cd2d89bc3298e49b8d4f98a21b8ffb 100644 (file)
@@ -25,7 +25,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 212fa78ecf98257ffa4f490b3c9d6466ea015df1..fd86e89e1125eea13e8a61dd3f90efb2e7811451 100644 (file)
@@ -17,7 +17,7 @@ all:  $(PROG)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 smtp-sink: smtp-sink.o $(LIBS)
        $(CC) $(CFLAGS) -o $@ smtp-sink.o $(LIBS) $(SYSLIBS)
@@ -114,14 +114,19 @@ qmqp-source.o: ../../include/vbuf.h
 qmqp-source.o: ../../include/vstream.h
 qmqp-source.o: ../../include/vstring.h
 qmqp-source.o: qmqp-source.c
+smtp-sink.o: ../../include/chroot_uid.h
 smtp-sink.o: ../../include/events.h
 smtp-sink.o: ../../include/get_hostname.h
 smtp-sink.o: ../../include/inet_proto.h
 smtp-sink.o: ../../include/iostuff.h
 smtp-sink.o: ../../include/listen.h
+smtp-sink.o: ../../include/mail_date.h
+smtp-sink.o: ../../include/make_dirs.h
 smtp-sink.o: ../../include/msg.h
 smtp-sink.o: ../../include/msg_vstream.h
+smtp-sink.o: ../../include/myaddrinfo.h
 smtp-sink.o: ../../include/mymalloc.h
+smtp-sink.o: ../../include/myrand.h
 smtp-sink.o: ../../include/sane_accept.h
 smtp-sink.o: ../../include/smtp_stream.h
 smtp-sink.o: ../../include/stringops.h
index bb51272001e0eb201c529cdbf6a382dbc3d53743..24d2cc2fea08676d7470ff433a9a1bb8031a7471 100644 (file)
@@ -18,7 +18,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 8b8d254bf2853460d4b30a197800a3ee9b381d2c..2c48df724d1a242ea834243f7c3c6121feb27eb3 100644 (file)
@@ -29,7 +29,7 @@ all: $(LIB)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 68cbe886c96d9d8a1e9373b2b65a07bffaf7beee..05301e47b7ce6a21acc5a6f9e9dc98f2b7795365 100644 (file)
@@ -19,7 +19,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (set -e; echo "# DO NOT EDIT"; $(OPTS) $(SHELL) ../../makedefs && cat $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index e8366c313e8cf7973323b94325bb3f216a7cc7b8..eadb385c01bb3f7810120de94ad3322239eca269 100644 (file)
@@ -23,7 +23,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index aadfe11c9aeb101c9e8bfff9aa14e3db4163677b..9a9d8e730ec5daf695f9eefa84f6c721bf358e5f 100644 (file)
@@ -110,7 +110,7 @@ all: $(LIB)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index c454c6712c63c8730be364d1a6287476d4e799dd..f9671f8dab363fd2bfb216b03cc583c67b9b71b7 100644 (file)
@@ -18,7 +18,7 @@ $(PROG): $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 55ee026a15276d4ab7e619de31e29497873db12c..51360fe43bcb7656e078568a118f043a4119f69d 100644 (file)
@@ -18,7 +18,7 @@ $(PROG):      $(OBJS) $(LIBS)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index 13d0eca2dbfb58999c3db79a6d08914f756f67cc..65aeb6894389e47f387ecb30c336496e0d03ea84 100644 (file)
@@ -25,7 +25,7 @@ all: $(LIB)
 $(OBJS): ../../conf/makedefs.out
 
 Makefile: Makefile.in
-       (cat ../../conf/makedefs.out $?) >$@
+       cat ../../conf/makedefs.out $? >$@
 
 test:  $(TESTPROG)
 
index bbaa7d15d40783884ec079b05481377ab3f1eb8b..4e525e0317729ee0ebb0fa91cdaee339824758b3 100644 (file)
@@ -159,7 +159,7 @@ static int xsasl_cyrus_client_get_user(void *context, int unused_id,
                                               const char **result,
                                               unsigned *len)
 {
-    const char *myname = "xsasl_cyrus_get_user";
+    const char *myname = "xsasl_cyrus_client_get_user";
     XSASL_CYRUS_CLIENT *client = (XSASL_CYRUS_CLIENT *) context;
 
     if (msg_verbose)
@@ -182,7 +182,7 @@ static int xsasl_cyrus_client_get_user(void *context, int unused_id,
 static int xsasl_cyrus_client_get_passwd(sasl_conn_t *conn, void *context,
                                            int id, sasl_secret_t **psecret)
 {
-    const char *myname = "xsasl_cyrus_get_passwd";
+    const char *myname = "xsasl_cyrus_client_get_passwd";
     XSASL_CYRUS_CLIENT *client = (XSASL_CYRUS_CLIENT *) context;
     int     len;