]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.2-20041118
authorWietse Venema <wietse@porcupine.org>
Thu, 18 Nov 2004 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:30:12 +0000 (06:30 +0000)
46 files changed:
postfix/HISTORY
postfix/README_FILES/SMTPD_ACCESS_README
postfix/README_FILES/SMTPD_POLICY_README
postfix/RELEASE_NOTES
postfix/html/SMTPD_ACCESS_README.html
postfix/html/SMTPD_POLICY_README.html
postfix/html/index.html
postfix/html/postconf.5.html
postfix/html/qmgr.8.html
postfix/html/smtp.8.html
postfix/html/smtpd.8.html
postfix/makedefs
postfix/man/man5/postconf.5
postfix/man/man8/qmgr.8
postfix/man/man8/smtp.8
postfix/man/man8/smtpd.8
postfix/mantools/postlink
postfix/proto/SMTPD_ACCESS_README.html
postfix/proto/SMTPD_POLICY_README.html
postfix/proto/postconf.proto
postfix/src/cleanup/cleanup_envelope.c
postfix/src/cleanup/cleanup_state.c
postfix/src/dns/dns_lookup.c
postfix/src/global/debug_process.c
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/local/forward.c
postfix/src/master/master.h
postfix/src/master/master_proto.c
postfix/src/master/master_proto.h
postfix/src/master/master_spawn.c
postfix/src/master/master_status.c
postfix/src/master/multi_server.c
postfix/src/master/single_server.c
postfix/src/master/trigger_server.c
postfix/src/oqmgr/qmgr_message.c
postfix/src/pickup/pickup.c
postfix/src/qmgr/qmgr.c
postfix/src/qmgr/qmgr_message.c
postfix/src/smtp/smtp.c
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd.h
postfix/src/smtpd/smtpd_check.c
postfix/src/smtpd/smtpd_check.h
postfix/src/smtpd/smtpd_state.c
postfix/src/util/dict.c

index 190e4536eace2d8145a9f878fff175fffd08cbb9..3217de6ca5419280d9e18c056fcab302127de295 100644 (file)
@@ -9823,6 +9823,63 @@ Apologies for any names omitted.
        Compatibility: "session cache" renamed to "connection cache"
        to avoid confusion with the TLS session cache.
 
+20041102
+
+       Feature: smtpd_end_of_data_restrictions allow you to specify
+       restrictions at the end of the SMTP DATA command. The syntax
+       is identical to that of the smtpd_data_restrictions feature.
+       This introduces a new END-OF-DATA protocol state for the
+       external policy server. Files:  proto/SMTPD_POLICY_README.html,
+       proto/SMTPD_ACCESS_README.html, smtpd/smtpd_check.c.
+
+20041111
+
+       Cleanup: terminate the dict_eval() result buffer for verbose
+       logging.  Victor Duchovni, Morgan Stanley. File: util/dict.c.
+
+20041112
+
+       Cleanup: be more careful when saving and restoring resolver(3)
+       options to avoid problems with an HP-UX security patch
+       (change introduced 20031215). File:  dns/dns_lookup.c.
+
+20041115
+
+       Bugfix: the test for "no debugger_command" was wrong.
+       Leandro Santi. File: global/debugger_command.c.
+
+20040117
+
+       Robustness: the master-child protocol now includes a process
+       generation number besides the child process ID.  The process
+       generation number is incremented by one each time the master
+       creates a child process. Child-to-master status updates
+       with the wrong generation number are ignored, instead of
+       triggering a consistency error in the master server.  Files:
+       master/*server.c, master/master_status.c, master/master_spawn.c.
+
+20041118
+
+       Bugfix: the "local_header_rewrite_clients" feature (20041023)
+       did not recognize "bare" lookup tables as documented.  Victor
+       Duchovni, Morgan Stanley. File: smtpd/smtpd_check.c.
+
+       Bugfix: the "local_header_rewrite_clients" feature (20041023)
+       was broken because the local delivery agent passed on a
+       bogus attribute value when forwarding internally generated
+       mail, causing the mail to be rejected by the cleanup server.
+       File: local/dotforward.c.
+
+       Bugfix: the "local_header_rewrite_clients" feature (20041023)
+       was broken because the pickup server always overwrote origin
+       information. Files: pickup/pickup.c, cleanup/cleanup_state.c,
+       *qmgr/qmgr_message.c.
+
+       Workaround: enable the "can't write before sending a file
+       descriptor" workaround for Solaris. Problem reported by
+       Victor Duchovni for Solaris 2.5.1, but we play safe and
+       enable it unconditionally.
+
 Open problems:
 
        Low: reject HELO with any domain name or IP address that
index 3e442b0c6f86e7138bbfff78190e57763af1a68c..dac578645fc6f8a631dc43825eddfbcecf89a52f 100644 (file)
@@ -136,21 +136,23 @@ The table below summarizes the purpose of each SMTP access restriction list.
 All lists use the exact same syntax; they differ only in the time of evaluation
 and in the effect of a REJECT or DEFER result.
 
-     _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b 
-    |R\bRe\bes\bst\btr\bri\bic\bct\bti\bio\bon\bn l\bli\bis\bst\bt n\bna\bam\bme\be       |S\bSt\bta\bat\btu\bus\bs  |E\bEf\bff\bfe\bec\bct\bt o\bof\bf R\bRE\bEJ\bJE\bEC\bCT\bT o\bor\br D\bDE\bEF\bFE\bER\bR r\bre\bes\bsu\bul\blt\bt|
-    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |smtpd_client_restrictions   |Optional|Reject all client commands      |
-    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |smtpd_helo_restrictions     |Optional|Reject HELO/EHLO information    |
-    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |smtpd_sender_restrictions   |Optional|Reject MAIL FROM information    |
-    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |smtpd_recipient_restrictions|Required|Reject RCPT TO information      |
-    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |smtpd_data_restrictions     |Optional|Reject DATA command             |
-    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
-    |smtpd_etrn_restrictions     |Optional|Reject ETRN command             |
-    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
+     _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b 
+    |R\bRe\bes\bst\btr\bri\bic\bct\bti\bio\bon\bn l\bli\bis\bst\bt n\bna\bam\bme\be         |S\bSt\bta\bat\btu\bus\bs  |E\bEf\bff\bfe\bec\bct\bt o\bof\bf R\bRE\bEJ\bJE\bEC\bCT\bT o\bor\br D\bDE\bEF\bFE\bER\bR r\bre\bes\bsu\bul\blt\bt|
+    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
+    |smtpd_client_restrictions     |Optional|Reject all client commands      |
+    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
+    |smtpd_helo_restrictions       |Optional|Reject HELO/EHLO information    |
+    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
+    |smtpd_sender_restrictions     |Optional|Reject MAIL FROM information    |
+    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
+    |smtpd_recipient_restrictions  |Required|Reject RCPT TO information      |
+    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
+    |smtpd_data_restrictions       |Optional|Reject DATA command             |
+    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
+    |smtpd_end_of_data_restrictions|Optional|Reject END-OF-DATA command      |
+    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
+    |smtpd_etrn_restrictions       |Optional|Reject ETRN command             |
+    |_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b|_\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b _\b |
 
 D\bDe\bel\bla\bay\bye\bed\bd e\bev\bva\bal\blu\bua\bat\bti\bio\bon\bn o\bof\bf S\bSM\bMT\bTP\bP a\bac\bcc\bce\bes\bss\bs r\bre\bes\bst\btr\bri\bic\bct\bti\bio\bon\bn l\bli\bis\bst\bts\bs
 
@@ -165,9 +167,9 @@ Current Postfix versions postpone the evaluation of client, helo and sender
 restriction lists until the RCPT TO or ETRN command. This behavior is
 controlled by the smtpd_delay_reject parameter. Restriction lists are still
 evaluated in the proper order of (client, helo, etrn) or (client, helo, sender,
-recipient, data) restrictions. When a restriction list (example: client)
-evaluates to REJECT or DEFER the other restriction lists (example: helo,
-sender, etc.) are skipped.
+recipient, data, or end-of-data) restrictions. When a restriction list
+(example: client) evaluates to REJECT or DEFER the other restriction lists
+(example: helo, sender, etc.) are skipped.
 
 Around the time that smtpd_delay_reject was introduced, Postfix was also
 changed to support mixed restriction lists that combine information about the
index b485acf954ed73e6fce9d1cc439fa39747442207..34ef8ba2c042eaf2f8d3b71209b1c8ed69509e61 100644 (file)
@@ -75,13 +75,18 @@ Notes:
   * The "instance" attribute value can be used to correlate different requests
     regarding the same message delivery.
 
+  * The "size" attribute value specifies the message size that the client
+    specified in the MAIL FROM command (zero if none was specified). With
+    Postfix 2.2 and later, it specifies the actual message size when the client
+    sends the END-OF-DATA command.
+
 The following is specific to SMTPD delegated policy requests:
 
   * Protocol names are ESMTP or SMTP.
 
-  * Protocol states are CONNECT, EHLO, HELO, MAIL, RCPT, DATA, VRFY or ETRN;
-    these are the SMTP protocol states where the Postfix SMTP server makes an
-    OK/REJECT/HOLD/etc. decision.
+  * Protocol states are CONNECT, EHLO, HELO, MAIL, RCPT, DATA, END-OF-DATA,
+    VRFY or ETRN; these are the SMTP protocol states where the Postfix SMTP
+    server makes an OK/REJECT/HOLD/etc. decision.
 
   * The SASL attributes are sent only when SASL support is built into Postfix.
 
index 98c353b4413819eddb14e505914ffcfb1eeec465..784c0de8aa62554cd6ea48da137c45204335a95c 100644 (file)
@@ -7,6 +7,21 @@ snapshot release).  Patches are issued for the official release
 and change the patchlevel and the release date. Patches are never
 issued for snapshot releases.
 
+Incompatible changes with snapshot Postfix-2.2-20041118
+=======================================================
+
+You must restart Postfix, because the master-child protocol has
+changed.  Postfix will log warnings about partial status updates
+if you forget to restart the master.
+
+Major changes with snapshot Postfix-2.2-20041118
+================================================
+
+New "smtpd_end_of_data_restrictions" feature that is invoked after
+the client terminates the SMTP DATA command. The syntax is the same
+as with "smtpd_data_restrictions", but the message size is the
+actual byte count of the message content.
+
 Incompatible changes with snapshot Postfix-2.2-20041030
 =======================================================
 
index 3435f7ef2de0b30beb913c3698d6656c2d461a3d..a91bec999d74041e8cb3195fa18b5de930f3e8c4 100644 (file)
@@ -216,6 +216,9 @@ Reject MAIL FROM information </td> </tr>
 <tr> <td> <a href="postconf.5.html#smtpd_data_restrictions">smtpd_data_restrictions</a> </td> <td> Optional </td> <td>
 Reject DATA command </td> </tr>
 
+<tr> <td> <a href="postconf.5.html#smtpd_end_of_data_restrictions">smtpd_end_of_data_restrictions</a> </td> <td> Optional </td> <td>
+Reject END-OF-DATA command </td> </tr>
+
 <tr> <td> <a href="postconf.5.html#smtpd_etrn_restrictions">smtpd_etrn_restrictions</a> </td> <td> Optional </td> <td>
 Reject ETRN command </td> </tr>
 
@@ -238,7 +241,8 @@ and so on. This approach turned out to be difficult to use. </p>
 helo and sender restriction lists until the RCPT TO or ETRN command.
 This behavior is controlled by the <a href="postconf.5.html#smtpd_delay_reject">smtpd_delay_reject</a> parameter.
 Restriction lists are still evaluated in the proper order of (client,
-helo, etrn) or (client, helo, sender, recipient, data) restrictions.
+helo, etrn) or (client, helo, sender, recipient, data, or end-of-data)
+restrictions.
 When a restriction list (example: client) evaluates to REJECT or
 DEFER the other restriction lists (example: helo, sender, etc.)
 are skipped.  </p>
index 5f69034787a85c2a9dc33a0943635884458ad3d9..3ee8625278d71090696e8810fbe45654e1e015ee 100644 (file)
@@ -114,6 +114,13 @@ size=12345
     <li> <p> The "instance" attribute value can be used to correlate
     different requests regarding the same message delivery. </p>
 
+    <li> <p> The "size" attribute value specifies the message size
+    that the client specified in the MAIL FROM command (zero if
+    none was specified). With Postfix 2.2 and later, it specifies
+    the actual message size when the client sends the END-OF-DATA
+    command.
+    </p>
+
 </ul>
 
 <p> The following is specific to SMTPD delegated policy requests:
@@ -124,7 +131,8 @@ size=12345
     <li> <p> Protocol names are ESMTP or SMTP. </p>
 
     <li> <p> Protocol states are CONNECT, EHLO, HELO, MAIL, RCPT,
-    DATA, VRFY or ETRN; these are the SMTP protocol states where
+    DATA, END-OF-DATA, VRFY or ETRN; these are the SMTP protocol
+    states where
     the Postfix SMTP server makes an OK/REJECT/HOLD/etc. decision.
     </p>
 
index 3eb80bf4869006b1b50594adfc61e840659342c5..d371c2c78f33cf61f707eac391519961e9ab126c 100644 (file)
@@ -3,8 +3,6 @@
 
 <html>
 
-<!-- TODO: all man pages of commands and daemons -->
-
 <head>
 
 <title>Postfix Documentation</title>
index 66599d4fa0c0be5f4bdf875d8c989aaca2dd12fc..e058eaf8073be64ef51c7b28c3f868de681c01c0 100644 (file)
@@ -3110,11 +3110,9 @@ client TLS certificate is successfully verified, regardless of
 whether it is listed on the server, and regardless of the certifying
 authority. </dd>
 
-<dt><b> <a name="check_address_map">check_address_map</a> <i><a
-href="DATABASE_README.html">type:table</a></i> </b></dt>
+<dt><b> <a name="check_address_map">check_address_map</a> <i><a href="DATABASE_README.html">type:table</a></i> </b></dt>
 
-<dt><b> <i><a href="DATABASE_README.html">type:table</a></i>
-</b></dt>
+<dt><b> <i><a href="DATABASE_README.html">type:table</a></i> </b></dt>
 
 <dd> Append the domain name in $<a href="postconf.5.html#myorigin">myorigin</a> or $<a href="postconf.5.html#mydomain">mydomain</a> when the
 client IP address matches the specified lookup table. The lookup
@@ -6532,7 +6530,8 @@ a restriction list, to make the default policy explicit.</dd>
 and the message has multiple envelope recipients. Although this
 usage is technically allowed, it seems to have no legitimate
 application. <br> NOTE: this restriction can only work reliably
-when used in <a href="postconf.5.html#smtpd_data_restrictions">smtpd_data_restrictions</a>, because the total number of
+when used in <a href="postconf.5.html#smtpd_data_restrictions">smtpd_data_restrictions</a> or
+<a href="postconf.5.html#smtpd_end_of_data_restrictions">smtpd_end_of_data_restrictions</a>, because the total number of
 recipients is not known at an earlier stage of the SMTP conversation.
 Use at the RCPT stage will only reject the second etc.  recipient.
 <br>
@@ -6667,6 +6666,19 @@ is being rejected.
 </p>
 
 
+</DD>
+
+<DT><b><a name="smtpd_end_of_data_restrictions">smtpd_end_of_data_restrictions</a>
+(default: empty)</b></DT><DD>
+
+<p> Optional access restrictions that the Postfix SMTP server
+applies in the context of the SMTP END-OF-DATA command. </p>
+
+<p> This feature is available in Postfix 2.2 and later. </p>
+
+<p> See <a href="postconf.5.html#smtpd_data_restrictions">smtpd_data_restrictions</a> for syntax details. </p>
+
+
 </DD>
 
 <DT><b><a name="smtpd_error_sleep_time">smtpd_error_sleep_time</a>
index fe9050aa7c657ad3501ad0c0e04ef32a6bced74a..91c289655a802310ebd185a09055609d188a4046 100644 (file)
@@ -366,6 +366,7 @@ QMGR(8)                                                   QMGR(8)
        <a href="trivial-rewrite.8.html">trivial-rewrite(8)</a>, address routing
        <a href="bounce.8.html">bounce(8)</a>, delivery status reports
        <a href="postconf.5.html">postconf(5)</a>, configuration parameters
+       <a href="master.5.html">master(5)</a>, generic daemon options
        <a href="master.8.html">master(8)</a>, process manager
        syslogd(8) system logging
 
index ed49cc183b26f81c29d7a428418be5f19d9132d6..28fc4b42bcc9147d5a62828924a9128ec8150d8c 100644 (file)
@@ -34,7 +34,7 @@ SMTP(8)                                                   SMTP(8)
        fails  due  to  a  recoverable  error  condition, the SMTP
        client will try to deliver the mail to an alternate  host.
 
-       After  a  successful  mail  transaction,  a session may be
+       After  a  successful mail transaction, a connection may be
        saved to the <a href="scache.8.html"><b>scache(8)</a></b> connection cache server, so that it
        may  be  used by any SMTP client for a subsequent transac-
        tion.
@@ -78,15 +78,14 @@ SMTP(8)                                                   SMTP(8)
 
        SMTP  connection caching assumes that SASL credentials are
        valid for all destinations  that  map  onto  the  same  IP
-       address  and  TCP  port,  and for all sender and recipient
-       addresses.
+       address and TCP port.
 
 <b>CONFIGURATION PARAMETERS</b>
        Changes to <b>main.cf</b> are picked up automatically, as <a href="smtp.8.html">smtp(8)</a>
-       processes  run  for only a limited amount of time. Use the
+       processes run for only a limited amount of time.  Use  the
        command "<b>postfix reload</b>" to speed up a change.
 
-       The text below provides  only  a  parameter  summary.  See
+       The  text  below  provides  only  a parameter summary. See
        <a href="postconf.5.html">postconf(5)</a> for more details including examples.
 
 <b>COMPATIBILITY CONTROLS</b>
@@ -100,7 +99,7 @@ SMTP(8)                                                   SMTP(8)
               Never send EHLO at the start of an SMTP session.
 
        <b><a href="postconf.5.html#smtp_defer_if_no_mx_address_found">smtp_defer_if_no_mx_address_found</a> (no)</b>
-              Defer  mail  delivery when no MX record resolves to
+              Defer mail delivery when no MX record  resolves  to
               an IP address.
 
        <b><a href="postconf.5.html#smtp_line_length_limit">smtp_line_length_limit</a> (990)</b>
@@ -108,17 +107,17 @@ SMTP(8)                                                   SMTP(8)
               that Postfix will send via SMTP.
 
        <b><a href="postconf.5.html#smtp_pix_workaround_delay_time">smtp_pix_workaround_delay_time</a> (10s)</b>
-              How  long  the  Postfix  SMTP  client pauses before
+              How long the  Postfix  SMTP  client  pauses  before
               sending ".&lt;CR&gt;&lt;LF&gt;" in order to work around the PIX
               firewall "&lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;" bug.
 
        <b><a href="postconf.5.html#smtp_pix_workaround_threshold_time">smtp_pix_workaround_threshold_time</a> (500s)</b>
-              How  long  a  message must be queued before the PIX
-              firewall  "&lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;"  bug  workaround   is
+              How long a message must be queued  before  the  PIX
+              firewall   "&lt;CR&gt;&lt;LF&gt;.&lt;CR&gt;&lt;LF&gt;"  bug  workaround  is
               turned on.
 
        <b><a href="postconf.5.html#smtp_quote_rfc821_envelope">smtp_quote_rfc821_envelope</a> (yes)</b>
-              Quote  addresses in SMTP MAIL FROM and RCPT TO com-
+              Quote addresses in SMTP MAIL FROM and RCPT TO  com-
               mands as required by <a href="http://www.faqs.org/rfcs/rfc821.html">RFC 821</a>.
 
        <b><a href="postconf.5.html#smtp_skip_5xx_greeting">smtp_skip_5xx_greeting</a> (yes)</b>
@@ -126,7 +125,7 @@ SMTP(8)                                                   SMTP(8)
               (go away, do not try again later).
 
        <b><a href="postconf.5.html#smtp_skip_quit_response">smtp_skip_quit_response</a> (yes)</b>
-              Do  not wait for the response to the SMTP QUIT com-
+              Do not wait for the response to the SMTP QUIT  com-
               mand.
 
        Available in Postfix version 2.0 and earlier:
@@ -139,7 +138,7 @@ SMTP(8)                                                   SMTP(8)
        Available in Postfix version 2.0 and later:
 
        <b><a href="postconf.5.html#disable_mime_output_conversion">disable_mime_output_conversion</a> (no)</b>
-              Disable  the  conversion of 8BITMIME format to 7BIT
+              Disable the conversion of 8BITMIME format  to  7BIT
               format.
 
        <b><a href="postconf.5.html#mime_boundary_length_limit">mime_boundary_length_limit</a> (2048)</b>
@@ -154,49 +153,49 @@ SMTP(8)                                                   SMTP(8)
        Available in Postfix version 2.1 and later:
 
        <b><a href="postconf.5.html#smtp_send_xforward_command">smtp_send_xforward_command</a> (no)</b>
-              Send the non-standard  XFORWARD  command  when  the
-              Postfix  SMTP  server EHLO response announces XFOR-
+              Send  the  non-standard  XFORWARD  command when the
+              Postfix SMTP server EHLO response  announces  XFOR-
               WARD support.
 
 <b>SASL AUTHENTICATION CONTROLS</b>
        <b><a href="postconf.5.html#smtp_sasl_auth_enable">smtp_sasl_auth_enable</a> (no)</b>
-              Enable SASL  authentication  in  the  Postfix  SMTP
+              Enable  SASL  authentication  in  the  Postfix SMTP
               client.
 
        <b><a href="postconf.5.html#smtp_sasl_password_maps">smtp_sasl_password_maps</a> (empty)</b>
-              Optional  SMTP  client lookup tables with one user-
-              name:password entry per remote hostname or  domain.
+              Optional SMTP client lookup tables with  one  user-
+              name:password  entry per remote hostname or domain.
 
        <b><a href="postconf.5.html#smtp_sasl_security_options">smtp_sasl_security_options</a> (noplaintext, noanonymous)</b>
-              What  authentication  mechanisms  the  Postfix SMTP
+              What authentication  mechanisms  the  Postfix  SMTP
               client is allowed to use.
 
        Available in Postfix version 2.2 and later:
 
        <b><a href="postconf.5.html#smtp_sasl_mechanism_filter">smtp_sasl_mechanism_filter</a> (empty)</b>
-              If non-empty, filters the  SMTP  server's  list  of
+              If  non-empty,  filters  the  SMTP server's list of
               offered SASL mechanisms.
 
 <b>RESOURCE AND RATE CONTROLS</b>
        <b><a href="postconf.5.html#smtp_destination_concurrency_limit">smtp_destination_concurrency_limit</a>      ($<a href="postconf.5.html#default_destination_concurrency_limit">default_destina</a>-</b>
        <b><a href="postconf.5.html#default_destination_concurrency_limit">tion_concurrency_limit</a>)</b>
-              The  maximal  number  of parallel deliveries to the
-              same destination  via  the  smtp  message  delivery
+              The maximal number of parallel  deliveries  to  the
+              same  destination  via  the  smtp  message delivery
               transport.
 
        <b><a href="postconf.5.html#smtp_destination_recipient_limit">smtp_destination_recipient_limit</a>        ($<a href="postconf.5.html#default_destination_recipient_limit">default_destina</a>-</b>
        <b><a href="postconf.5.html#default_destination_recipient_limit">tion_recipient_limit</a>)</b>
-              The  maximal  number of recipients per delivery via
+              The maximal number of recipients per  delivery  via
               the smtp message delivery transport.
 
        <b><a href="postconf.5.html#smtp_connect_timeout">smtp_connect_timeout</a> (30s)</b>
-              The SMTP client time limit  for  completing  a  TCP
+              The  SMTP  client  time  limit for completing a TCP
               connection,  or  zero  (use  the  operating  system
               built-in time limit).
 
        <b><a href="postconf.5.html#smtp_helo_timeout">smtp_helo_timeout</a> (300s)</b>
-              The SMTP client time limit for sending the HELO  or
-              EHLO  command, and for receiving the initial server
+              The  SMTP client time limit for sending the HELO or
+              EHLO command, and for receiving the initial  server
               response.
 
        <b><a href="postconf.5.html#smtp_xforward_timeout">smtp_xforward_timeout</a> (300s)</b>
@@ -204,30 +203,30 @@ SMTP(8)                                                   SMTP(8)
               command, and for receiving the server response.
 
        <b><a href="postconf.5.html#smtp_mail_timeout">smtp_mail_timeout</a> (300s)</b>
-              The  SMTP  client  time  limit for sending the MAIL
-              FROM  command,  and  for   receiving   the   server
+              The SMTP client time limit  for  sending  the  MAIL
+              FROM   command,   and   for  receiving  the  server
               response.
 
        <b><a href="postconf.5.html#smtp_rcpt_timeout">smtp_rcpt_timeout</a> (300s)</b>
-              The  SMTP  client  time  limit for sending the SMTP
-              RCPT TO  command,  and  for  receiving  the  server
+              The SMTP client time limit  for  sending  the  SMTP
+              RCPT  TO  command,  and  for  receiving  the server
               response.
 
        <b><a href="postconf.5.html#smtp_data_init_timeout">smtp_data_init_timeout</a> (120s)</b>
-              The  SMTP  client  time  limit for sending the SMTP
-              DATA  command,  and  for   receiving   the   server
+              The SMTP client time limit  for  sending  the  SMTP
+              DATA   command,   and   for  receiving  the  server
               response.
 
        <b><a href="postconf.5.html#smtp_data_xfer_timeout">smtp_data_xfer_timeout</a> (180s)</b>
-              The  SMTP  client  time  limit for sending the SMTP
+              The SMTP client time limit  for  sending  the  SMTP
               message content.
 
        <b><a href="postconf.5.html#smtp_data_done_timeout">smtp_data_done_timeout</a> (600s)</b>
-              The SMTP client time limit  for  sending  the  SMTP
+              The  SMTP  client  time  limit for sending the SMTP
               ".", and for receiving the server response.
 
        <b><a href="postconf.5.html#smtp_quit_timeout">smtp_quit_timeout</a> (300s)</b>
-              The  SMTP  client  time  limit for sending the QUIT
+              The SMTP client time limit  for  sending  the  QUIT
               command, and for receiving the server response.
 
        Available in Postfix version 2.1 and later:
@@ -238,77 +237,77 @@ SMTP(8)                                                   SMTP(8)
               lookups, or zero (no limit).
 
        <b><a href="postconf.5.html#smtp_mx_session_limit">smtp_mx_session_limit</a> (2)</b>
-              The maximal number of SMTP  sessions  per  delivery
-              request  before  giving up or delivering to a fall-
+              The  maximal  number  of SMTP sessions per delivery
+              request before giving up or delivering to  a  fall-
               back relay host, or zero (no limit).
 
        <b><a href="postconf.5.html#smtp_rset_timeout">smtp_rset_timeout</a> (20s)</b>
-              The SMTP client time limit  for  sending  the  RSET
+              The  SMTP  client  time  limit for sending the RSET
               command, and for receiving the server response.
 
        Available in Postfix version 2.2 and later:
 
        <b><a href="postconf.5.html#smtp_connection_cache_destinations">smtp_connection_cache_destinations</a> (empty)</b>
-              Permanently  enable SMTP connection caching for the
+              Permanently enable SMTP connection caching for  the
               specified destinations.
 
        <b><a href="postconf.5.html#smtp_connection_cache_on_demand">smtp_connection_cache_on_demand</a> (yes)</b>
-              Temporarily enable SMTP connection caching while  a
+              Temporarily  enable SMTP connection caching while a
               destination has a high volume of mail in the active
               queue.
 
        <b><a href="postconf.5.html#smtp_connection_cache_reuse_limit">smtp_connection_cache_reuse_limit</a> (10)</b>
               When SMTP connection caching is enabled, the number
-              of  times  that an SMTP session is reused before it
+              of times that an SMTP session is reused  before  it
               is closed.
 
        <b><a href="postconf.5.html#smtp_connection_cache_time_limit">smtp_connection_cache_time_limit</a> (2s)</b>
               When SMTP connection caching is enabled, the amount
-              of  time  that an unused SMTP client socket is kept
+              of time that an unused SMTP client socket  is  kept
               open before it is closed.
 
 <b>TROUBLE SHOOTING CONTROLS</b>
        <b><a href="postconf.5.html#debug_peer_level">debug_peer_level</a> (2)</b>
-              The increment  in  verbose  logging  level  when  a
-              remote  client  or  server matches a pattern in the
+              The  increment  in  verbose  logging  level  when a
+              remote client or server matches a  pattern  in  the
               <a href="postconf.5.html#debug_peer_list">debug_peer_list</a> parameter.
 
        <b><a href="postconf.5.html#debug_peer_list">debug_peer_list</a> (empty)</b>
-              Optional list of remote client or  server  hostname
-              or  network address patterns that cause the verbose
-              logging level to increase by the  amount  specified
+              Optional  list  of remote client or server hostname
+              or network address patterns that cause the  verbose
+              logging  level  to increase by the amount specified
               in $<a href="postconf.5.html#debug_peer_level">debug_peer_level</a>.
 
        <b><a href="postconf.5.html#error_notice_recipient">error_notice_recipient</a> (postmaster)</b>
-              The  recipient  of  postmaster  notifications about
-              mail delivery problems that are caused  by  policy,
+              The recipient  of  postmaster  notifications  about
+              mail  delivery  problems that are caused by policy,
               resource, software or protocol errors.
 
        <b><a href="postconf.5.html#notify_classes">notify_classes</a> (resource, software)</b>
-              The  list of error classes that are reported to the
+              The list of error classes that are reported to  the
               postmaster.
 
 <b>MISCELLANEOUS CONTROLS</b>
        <b><a href="postconf.5.html#best_mx_transport">best_mx_transport</a> (empty)</b>
-              Where the Postfix SMTP client should  deliver  mail
+              Where  the  Postfix SMTP client should deliver mail
               when it detects a "mail loops back to myself" error
               condition.
 
        <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
-              The default location of  the  Postfix  main.cf  and
+              The  default  location  of  the Postfix main.cf and
               master.cf configuration files.
 
        <b><a href="postconf.5.html#daemon_timeout">daemon_timeout</a> (18000s)</b>
-              How  much time a Postfix daemon process may take to
-              handle a request  before  it  is  terminated  by  a
+              How much time a Postfix daemon process may take  to
+              handle  a  request  before  it  is  terminated by a
               built-in watchdog timer.
 
        <b><a href="postconf.5.html#disable_dns_lookups">disable_dns_lookups</a> (no)</b>
-              Disable  DNS  lookups  in the Postfix SMTP and LMTP
+              Disable DNS lookups in the Postfix  SMTP  and  LMTP
               clients.
 
        <b><a href="postconf.5.html#fallback_relay">fallback_relay</a> (empty)</b>
-              Optional list of relay hosts for SMTP  destinations
+              Optional  list of relay hosts for SMTP destinations
               that can't be found or that are unreachable.
 
        <b><a href="postconf.5.html#inet_interfaces">inet_interfaces</a> (all)</b>
@@ -320,25 +319,25 @@ SMTP(8)                                                   SMTP(8)
               over an internal communication channel.
 
        <b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
-              The  maximum  amount  of  time that an idle Postfix
-              daemon process waits for the next  service  request
+              The maximum amount of time  that  an  idle  Postfix
+              daemon  process  waits for the next service request
               before exiting.
 
        <b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
-              The  maximal number of connection requests before a
+              The maximal number of connection requests before  a
               Postfix daemon process terminates.
 
        <b><a href="postconf.5.html#process_id">process_id</a> (read-only)</b>
-              The process ID of a Postfix command or daemon  pro-
+              The  process ID of a Postfix command or daemon pro-
               cess.
 
        <b><a href="postconf.5.html#process_name">process_name</a> (read-only)</b>
-              The  process  name  of  a Postfix command or daemon
+              The process name of a  Postfix  command  or  daemon
               process.
 
        <b><a href="postconf.5.html#proxy_interfaces">proxy_interfaces</a> (empty)</b>
               The network interface addresses that this mail sys-
-              tem  receives  mail on by way of a proxy or network
+              tem receives mail on by way of a proxy  or  network
               address translation unit.
 
        <b><a href="postconf.5.html#smtp_bind_address">smtp_bind_address</a> (empty)</b>
@@ -346,22 +345,22 @@ SMTP(8)                                                   SMTP(8)
               client should bind to when making a connection.
 
        <b><a href="postconf.5.html#smtp_helo_name">smtp_helo_name</a> ($<a href="postconf.5.html#myhostname">myhostname</a>)</b>
-              The  hostname to send in the SMTP EHLO or HELO com-
+              The hostname to send in the SMTP EHLO or HELO  com-
               mand.
 
        <b><a href="postconf.5.html#smtp_host_lookup">smtp_host_lookup</a> (dns)</b>
-              What mechanisms when the SMTP client uses  to  look
+              What  mechanisms  when the SMTP client uses to look
               up a host's IP address.
 
        <b><a href="postconf.5.html#smtp_randomize_addresses">smtp_randomize_addresses</a> (yes)</b>
-              Randomize  the  order  of  equal-preference MX host
+              Randomize the order  of  equal-preference  MX  host
               addresses.
 
        <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
               The syslog facility of Postfix logging.
 
        <b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
-              The mail system name that is prepended to the  pro-
+              The  mail system name that is prepended to the pro-
               cess  name  in  syslog  records,  so  that  "smtpd"
               becomes, for example, "postfix/smtpd".
 
@@ -370,6 +369,7 @@ SMTP(8)                                                   SMTP(8)
        <a href="bounce.8.html">bounce(8)</a>, delivery status reports
        <a href="scache.8.html">scache(8)</a>, connection cache server
        <a href="postconf.5.html">postconf(5)</a>, configuration parameters
+       <a href="master.5.html">master(5)</a>, generic daemon options
        <a href="master.8.html">master(8)</a>, process manager
        syslogd(8), system logging
 
@@ -377,7 +377,7 @@ SMTP(8)                                                   SMTP(8)
        <a href="SASL_README.html">SASL_README</a>, Postfix SASL howto
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>AUTHOR(S)</b>
index 4fc7cd37b7d5ce77a3c85aeff7c18f76593882c1..047ff5faf9c4d8b6b38431e05151a12d34c58120 100644 (file)
@@ -582,6 +582,13 @@ SMTPD(8)                                                 SMTPD(8)
               explicit <a href="postconf.5.html#reject_unlisted_recipient">reject_unlisted_recipient</a> access  restric-
               tion is specified.
 
+       Available in Postfix version 2.2 and later:
+
+       <b><a href="postconf.5.html#smtpd_end_of_data_restrictions">smtpd_end_of_data_restrictions</a> (empty)</b>
+              Optional  access restrictions that the Postfix SMTP
+              server applies in the context of the  SMTP  END-OF-
+              DATA command.
+
 <b>SENDER AND RECIPIENT ADDRESS VERIFICATION CONTROLS</b>
        Postfix   version  2.1  introduces  sender  and  recipient
        address verification.   This  feature  is  implemented  by
@@ -779,6 +786,7 @@ SMTPD(8)                                                 SMTPD(8)
        <a href="trivial-rewrite.8.html">trivial-rewrite(8)</a>, address resolver
        <a href="verify.8.html">verify(8)</a>, address verification service
        <a href="postconf.5.html">postconf(5)</a>, configuration parameters
+       <a href="master.5.html">master(5)</a>, generic daemon options
        <a href="master.8.html">master(8)</a>, process manager
        syslogd(8), system logging
 
index 7fb2a0a9f616eef393ea71c921bae60aefdae0f0..3065eab80e437a789eaa1b5b92d657aae2bb7121 100644 (file)
@@ -136,6 +136,7 @@ case "$SYSTEM.$RELEASE" in
                    5.[0-4]) CCARGS="$CCARGS -DMISSING_USLEEP";;
                          *) CCARGS="$CCARGS -DHAS_POSIX_REGEXP";;
                esac
+               CCARGS="$CCARGS -DCANT_WRITE_BEFORE_SENDING_FD"
                # Solaris 9 added closefrom()
                case $RELEASE in
                    5.9*|5.[1-9][0-9]*) CCARGS="$CCARGS -DHAS_CLOSEFROM";;
index c19b82f59839aa4c5a653dd7e92ad2b648125a07..90ffcaadb2ca62dbd32189a15aee2c55d00e14bf 100644 (file)
@@ -1585,10 +1585,8 @@ Append the domain name in $myorigin or $mydomain when the
 client TLS certificate is successfully verified, regardless of
 whether it is listed on the server, and regardless of the certifying
 authority.
-.IP "\fB check_address_map \fI<a
-href="DATABASE_README.html">type:table\fR \fR"
-.IP "\fB \fItype:table\fR
-\fR"
+.IP "\fB check_address_map \fItype:table\fR \fR"
+.IP "\fB \fItype:table\fR \fR"
 Append the domain name in $myorigin or $mydomain when the
 client IP address matches the specified lookup table. The lookup
 result is ignored, and no subnet lookup is done. This is suitable
@@ -3530,7 +3528,8 @@ usage is technically allowed, it seems to have no legitimate
 application.
 .br
 NOTE: this restriction can only work reliably
-when used in smtpd_data_restrictions, because the total number of
+when used in smtpd_data_restrictions or
+smtpd_end_of_data_restrictions, because the total number of
 recipients is not known at an earlier stage of the SMTP conversation.
 Use at the RCPT stage will only reject the second etc.  recipient.
 .br
@@ -3625,6 +3624,13 @@ The default setting has one major benefit: it allows Postfix to log
 recipient address information when rejecting a client name/address
 or sender address, so that it is possible to find out whose mail
 is being rejected.
+.SH smtpd_end_of_data_restrictions (default: empty)
+Optional access restrictions that the Postfix SMTP server
+applies in the context of the SMTP END-OF-DATA command.
+.PP
+This feature is available in Postfix 2.2 and later.
+.PP
+See smtpd_data_restrictions for syntax details.
 .SH smtpd_error_sleep_time (default: 1s)
 With Postfix 2.1 and later: the SMTP server response delay after
 a client has made more than $smtpd_soft_error_limit errors, and
index b90e2ad98e91f08c79205c97c0cf50d439f3bd45..561674af9480ad5536325a872d0c8b1ec34067b0 100644 (file)
@@ -326,6 +326,7 @@ records, so that "smtpd" becomes, for example, "postfix/smtpd".
 trivial-rewrite(8), address routing
 bounce(8), delivery status reports
 postconf(5), configuration parameters
+master(5), generic daemon options
 master(8), process manager
 syslogd(8) system logging
 .SH "README FILES"
index c5be8ab70e1576e8be002739506fe7cfcb0abd5c..83bb849e149fc1e1927d0a59cea4f9d848142c9c 100644 (file)
@@ -32,7 +32,7 @@ When a server is not reachable, or when mail delivery fails due
 to a recoverable error condition, the SMTP client will try to
 deliver the mail to an alternate host.
 
-After a successful mail transaction, a session may be saved
+After a successful mail transaction, a connection may be saved
 to the \fBscache(8)\fR connection cache server, so that it
 may be used by any SMTP client for a subsequent transaction.
 
@@ -79,8 +79,7 @@ support for TLS object passivation and re-activation does not
 exist without closing the session, which defeats the purpose.
 
 SMTP connection caching assumes that SASL credentials are valid for
-all destinations that map onto the same IP address and TCP port,
-and for all sender and recipient addresses.
+all destinations that map onto the same IP address and TCP port.
 .SH "CONFIGURATION PARAMETERS"
 .na
 .nf
@@ -308,6 +307,7 @@ qmgr(8), queue manager
 bounce(8), delivery status reports
 scache(8), connection cache server
 postconf(5), configuration parameters
+master(5), generic daemon options
 master(8), process manager
 syslogd(8), system logging
 .SH "README FILES"
index 01709f279935befc92dcd10625bd662e15519c0e..954ac2d95a71d720ccdf5b585c294568ccf5d2c8 100644 (file)
@@ -487,6 +487,11 @@ access restriction is specified.
 Request that the Postfix SMTP server rejects mail for unknown
 recipient addresses, even when no explicit reject_unlisted_recipient
 access restriction is specified.
+.PP
+Available in Postfix version 2.2 and later:
+.IP "\fBsmtpd_end_of_data_restrictions (empty)\fR"
+Optional access restrictions that the Postfix SMTP server
+applies in the context of the SMTP END-OF-DATA command.
 .SH "SENDER AND RECIPIENT ADDRESS VERIFICATION CONTROLS"
 .na
 .nf
@@ -633,6 +638,7 @@ cleanup(8), message canonicalization
 trivial-rewrite(8), address resolver
 verify(8), address verification service
 postconf(5), configuration parameters
+master(5), generic daemon options
 master(8), process manager
 syslogd(8), system logging
 .SH "README FILES"
index 612a7a600d9dea8f53cba8882d49dc7e9b337575..662883cd66f57943d4eee8023d6545ddfed3a338 100755 (executable)
@@ -366,6 +366,7 @@ while (<>) {
     s;\bsmtpd_client_restrictions\b;<a href="postconf.5.html#smtpd_client_restrictions">$&</a>;g;
     s;\bsmtpd_data_restrictions\b;<a href="postconf.5.html#smtpd_data_restrictions">$&</a>;g;
     s;\bsmtpd_delay_reject\b;<a href="postconf.5.html#smtpd_delay_reject">$&</a>;g;
+    s;\bsmtpd_end_of_data_restrictions\b;<a href="postconf.5.html#smtpd_end_of_data_restrictions">$&</a>;g;
     s;\bsmtpd_error_sleep_time\b;<a href="postconf.5.html#smtpd_error_sleep_time">$&</a>;g;
     s;\bsmtpd_etrn_restrictions\b;<a href="postconf.5.html#smtpd_etrn_restrictions">$&</a>;g;
     s;\bsmtpd_expansion_filter\b;<a href="postconf.5.html#smtpd_expansion_filter">$&</a>;g;
index 70dbcf8b200d50de141c008078dd5953a2cc2427..e271afebd2c949a7e434de4436fc4e2383a29c70 100644 (file)
@@ -216,6 +216,9 @@ Reject MAIL FROM information </td> </tr>
 <tr> <td> smtpd_data_restrictions </td> <td> Optional </td> <td>
 Reject DATA command </td> </tr>
 
+<tr> <td> smtpd_end_of_data_restrictions </td> <td> Optional </td> <td>
+Reject END-OF-DATA command </td> </tr>
+
 <tr> <td> smtpd_etrn_restrictions </td> <td> Optional </td> <td>
 Reject ETRN command </td> </tr>
 
@@ -238,7 +241,8 @@ and so on. This approach turned out to be difficult to use. </p>
 helo and sender restriction lists until the RCPT TO or ETRN command.
 This behavior is controlled by the smtpd_delay_reject parameter.
 Restriction lists are still evaluated in the proper order of (client,
-helo, etrn) or (client, helo, sender, recipient, data) restrictions.
+helo, etrn) or (client, helo, sender, recipient, data, or end-of-data)
+restrictions.
 When a restriction list (example: client) evaluates to REJECT or
 DEFER the other restriction lists (example: helo, sender, etc.)
 are skipped.  </p>
index d406984d25ae3930ecac250b0b4b924c85edbea6..65ab323fac9c11f3690737b1887ae4e0ff0b0fa8 100644 (file)
@@ -114,6 +114,13 @@ size=12345
     <li> <p> The "instance" attribute value can be used to correlate
     different requests regarding the same message delivery. </p>
 
+    <li> <p> The "size" attribute value specifies the message size
+    that the client specified in the MAIL FROM command (zero if
+    none was specified). With Postfix 2.2 and later, it specifies
+    the actual message size when the client sends the END-OF-DATA
+    command.
+    </p>
+
 </ul>
 
 <p> The following is specific to SMTPD delegated policy requests:
@@ -124,7 +131,8 @@ size=12345
     <li> <p> Protocol names are ESMTP or SMTP. </p>
 
     <li> <p> Protocol states are CONNECT, EHLO, HELO, MAIL, RCPT,
-    DATA, VRFY or ETRN; these are the SMTP protocol states where
+    DATA, END-OF-DATA, VRFY or ETRN; these are the SMTP protocol
+    states where
     the Postfix SMTP server makes an OK/REJECT/HOLD/etc. decision.
     </p>
 
index d08cad61d98bb5aa9a4060c86d6c5d889a322e8b..f462ac8b169706b957de8a19af571cc894442044 100644 (file)
@@ -4208,7 +4208,8 @@ a restriction list, to make the default policy explicit.</dd>
 and the message has multiple envelope recipients. Although this
 usage is technically allowed, it seems to have no legitimate
 application. <br> NOTE: this restriction can only work reliably
-when used in smtpd_data_restrictions, because the total number of
+when used in smtpd_data_restrictions or 
+smtpd_end_of_data_restrictions, because the total number of
 recipients is not known at an earlier stage of the SMTP conversation.
 Use at the RCPT stage will only reject the second etc.  recipient.
 <br>
@@ -6666,6 +6667,15 @@ smtpd_data_restrictions = reject_unauth_pipelining
 smtpd_data_restrictions = reject_multi_recipient_bounce
 </pre>
 
+%PARAM smtpd_end_of_data_restrictions 
+
+<p> Optional access restrictions that the Postfix SMTP server
+applies in the context of the SMTP END-OF-DATA command. </p>
+
+<p> This feature is available in Postfix 2.2 and later. </p>
+
+<p> See smtpd_data_restrictions for syntax details. </p>
+
 %PARAM smtpd_delay_reject yes
 
 <p>
@@ -7280,11 +7290,9 @@ client TLS certificate is successfully verified, regardless of
 whether it is listed on the server, and regardless of the certifying
 authority. </dd>
 
-<dt><b> <a name="check_address_map">check_address_map</a> <i><a
-href="DATABASE_README.html">type:table</a></i> </b></dt>
+<dt><b> <a name="check_address_map">check_address_map</a> <i><a href="DATABASE_README.html">type:table</a></i> </b></dt>
 
-<dt><b> <i><a href="DATABASE_README.html">type:table</a></i>
-</b></dt>
+<dt><b> <i><a href="DATABASE_README.html">type:table</a></i> </b></dt>
 
 <dd> Append the domain name in $myorigin or $mydomain when the
 client IP address matches the specified lookup table. The lookup
index a2063f984c4a447fec2c8a436e991df851e5e9d8..e4b31661c4be736e7074b865128ce444f551949a 100644 (file)
@@ -280,18 +280,25 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type,
            myfree(sbuf);
            return;
        }
+       /* Zero-length values are place holders for unavailable values. */
+       if (*attr_value == 0) {
+           msg_warn("%s: spurious null attribute value for \"%s\" -- ignored",
+                    state->queue_id, attr_name);
+           myfree(sbuf);
+           return;
+       }
        if (strcmp(attr_name, MAIL_ATTR_RWR_CONTEXT) == 0) {
            /* Choose header rewriting context. See also cleanup_addr.c. */
            if (STREQ(attr_value, MAIL_ATTR_RWR_LOCAL)) {
                state->hdr_rewrite_context = MAIL_ATTR_RWR_LOCAL;
            } else if (STREQ(attr_value, MAIL_ATTR_RWR_REMOTE)) {
-               state->hdr_rewrite_context = 
-                   (*var_remote_rwr_domain ?  MAIL_ATTR_RWR_REMOTE : 0);
+               state->hdr_rewrite_context =
+                   (*var_remote_rwr_domain ? MAIL_ATTR_RWR_REMOTE : 0);
            } else {
-                msg_warn("%s: message rejected: bad rewriting context: %.100s",
-                         state->queue_id, attr_value);
-                state->errs |= CLEANUP_STAT_BAD;
-                return;
+               msg_warn("%s: message rejected: bad rewriting context: %.100s",
+                        state->queue_id, attr_value);
+               state->errs |= CLEANUP_STAT_BAD;
+               return;
            }
        }
        nvtable_update(state->attr, attr_name, attr_value);
index 3c761a572c3a0d8b57c9f660a3646a736a358dc8..cd36bc8b41eb9d8d72fc5836847f97ac9f74ab43 100644 (file)
@@ -83,6 +83,7 @@ CLEANUP_STATE *cleanup_state_alloc(void)
     state->rcpt_count = 0;
     state->reason = 0;
     state->attr = nvtable_create(10);
+    nvtable_update(state->attr, MAIL_ATTR_ORIGIN, MAIL_ATTR_ORG_LOCAL);
     state->mime_state = 0;
     state->mime_errs = 0;
     state->hdr_rewrite_context = MAIL_ATTR_RWR_LOCAL;
index 7fd1528f5b9307b2a1396a2bc98b83f8028c6e68..03b4aaf5ff32a5ca11b2c0c475493121f2e7fda0 100644 (file)
@@ -141,7 +141,7 @@ static int dns_query(const char *name, int type, int flags,
 {
     HEADER *reply_header;
     int     len;
-    unsigned long saved_options = _res.options;
+    unsigned long saved_options;
 
     /*
      * Initialize the name service.
@@ -160,7 +160,8 @@ static int dns_query(const char *name, int type, int flags,
 
     if ((flags & USER_FLAGS) != flags)
        msg_panic("dns_query: bad flags: %d", flags);
-    _res.options &= ~(USER_FLAGS);
+    saved_options = (_res.options & USER_FLAGS);
+    _res.options &= ~saved_options;
     _res.options |= flags;
 
     /*
@@ -168,7 +169,8 @@ static int dns_query(const char *name, int type, int flags,
      * only if the name server told us so.
      */
     len = res_search((char *) name, C_IN, type, reply->buf, sizeof(reply->buf));
-    _res.options = saved_options;
+    _res.options &= ~flags;
+    _res.options |= saved_options;
     if (len < 0) {
        if (why)
            vstring_sprintf(why, "Host or domain name not found. "
index d045678636640204d3fdbf9cf9e6d6191d28ab08..504cbd10960bccd60e6c71ca2d225b6c810b0218 100644 (file)
@@ -55,7 +55,7 @@ void    debug_process(void)
      * Expand $debugger_command then run it.
      */
     command = mail_conf_lookup_eval(VAR_DEBUG_COMMAND);
-    if (*command == 0)
+    if (command == 0 || *command == 0)
        msg_fatal("no %s variable set up", VAR_DEBUG_COMMAND);
     msg_info("running: %s", command);
     system(command);
index bc2e4e6a712486c3611f3c180ca5987e2e97aba4..197893f2f12af4caf3e9181708bce0673e00c8ed 100644 (file)
@@ -1332,6 +1332,10 @@ extern char *var_etrn_checks;
 #define DEF_DATA_CHECKS                ""
 extern char *var_data_checks;
 
+#define VAR_EOD_CHECKS         "smtpd_end_of_data_restrictions"
+#define DEF_EOD_CHECKS         ""
+extern char *var_eod_checks;
+
 #define VAR_REST_CLASSES       "smtpd_restriction_classes"
 #define DEF_REST_CLASSES       ""
 extern char *var_rest_classes;
index 791c85f618ce851fb8944bdb46dbff3391562c77..1aaa9489417f5d09f0c5dc019522b8773fbb2ba6 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only.
   */
-#define MAIL_RELEASE_DATE      "20041030"
+#define MAIL_RELEASE_DATE      "20041118"
 #define MAIL_VERSION_NUMBER    "2.2"
 
 #define VAR_MAIL_VERSION       "mail_version"
index 81fab30b64567ad8be55740971dceb7db15f3f90..8c89aede72eba1669999794d59019417c6dc322f 100644 (file)
@@ -152,24 +152,27 @@ static FORWARD_INFO *forward_open(DELIVER_REQUEST *request, char *sender)
      * designated sender: mailing list owner, posting user, whatever.
      */
     rec_fprintf(cleanup, REC_TYPE_TIME, "%ld", (long) info->posting_time);
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_CLIENT_NAME, request->client_name);
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_CLIENT_ADDR, request->client_addr);
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_PROTO_NAME, request->client_proto);
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_HELO_NAME, request->client_helo);
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_SASL_METHOD, request->sasl_method);
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_SASL_USERNAME, request->sasl_username);
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_SASL_SENDER, request->sasl_sender);
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_RWR_CONTEXT, request->rewrite_context);
     rec_fputs(cleanup, REC_TYPE_FROM, sender);
 
+    /*
+     * Zero-length attribute values are place holders for unavailable
+     * attribute values. See qmgr_message.c. They are not meant to be
+     * propagated to queue files.
+     */
+#define PASS_ATTR(fp, name, value) do { \
+    if ((value) && *(value)) \
+       rec_fprintf((fp), REC_TYPE_ATTR, "%s=%s", (name), (value)); \
+    } while (0)
+
+    PASS_ATTR(cleanup, MAIL_ATTR_CLIENT_NAME, request->client_name);
+    PASS_ATTR(cleanup, MAIL_ATTR_CLIENT_ADDR, request->client_addr);
+    PASS_ATTR(cleanup, MAIL_ATTR_PROTO_NAME, request->client_proto);
+    PASS_ATTR(cleanup, MAIL_ATTR_HELO_NAME, request->client_helo);
+    PASS_ATTR(cleanup, MAIL_ATTR_SASL_METHOD, request->sasl_method);
+    PASS_ATTR(cleanup, MAIL_ATTR_SASL_USERNAME, request->sasl_username);
+    PASS_ATTR(cleanup, MAIL_ATTR_SASL_SENDER, request->sasl_sender);
+    PASS_ATTR(cleanup, MAIL_ATTR_RWR_CONTEXT, request->rewrite_context);
+
     vstring_free(buffer);
     return (info);
 }
index 3cc481207901fd925c82b284ba63d37c3b261d6d..95b5e491ba3895ded07e9f27a837cc44e410b4f7 100644 (file)
@@ -77,6 +77,7 @@ typedef int MASTER_PID;                       /* pid is key into binhash table */
 
 typedef struct MASTER_PROC {
     MASTER_PID pid;                    /* child process id */
+    unsigned gen;                      /* child generation number */
     int     avail;                     /* availability */
     MASTER_SERV *serv;                 /* parent linkage */
     int     use_count;                 /* number of service requests */
index 00e9c19ddc027c99f10684b19659307bd92bb26a..d1247479b0b6c3ef89f1abaaa18e1a13df20b5c6 100644 (file)
@@ -6,8 +6,9 @@
 /* SYNOPSIS
 /*     #include <master_proto.h>
 /*
-/*     int     master_notify(pid, status)
+/*     int     master_notify(pid, generation, status)
 /*     int     pid;
+/*     unsigned generation;
 /*     int     status;
 /* DESCRIPTION
 /*     The master process provides a standard environment for its
@@ -61,7 +62,7 @@
 
 #include "master_proto.h"
 
-int     master_notify(int pid, int status)
+int     master_notify(int pid, unsigned generation, int status)
 {
     char   *myname = "master_notify";
     MASTER_STATUS stat;
@@ -73,6 +74,7 @@ int     master_notify(int pid, int status)
      * bad status code will only have amusement value.
      */
     stat.pid = pid;
+    stat.gen = generation;
     stat.avail = status;
 
     if (write(MASTER_STATUS_FD, (char *) &stat, sizeof(stat)) != sizeof(stat)) {
index 36c30f8d5bbcf68160320a16affb466787ed7221..fc48fa0924fef0caa4effc84de4c40c5f6304f95 100644 (file)
   */
 typedef struct MASTER_STATUS {
     int     pid;                       /* process ID */
+    unsigned gen;                      /* child generation number */
     int     avail;                     /* availability */
 } MASTER_STATUS;
 
+#define MASTER_GEN_NAME        "GENERATION"    /* passed via environment */
+
 #define MASTER_STAT_TAKEN      0       /* this one is occupied */
 #define MASTER_STAT_AVAIL      1       /* this process is idle */
 
-extern int master_notify(int, int);    /* encapsulate status msg */
+extern int master_notify(int, unsigned, int);  /* encapsulate status msg */
 
  /*
   * File descriptors inherited from the master process. The flow control pipe
index 2eaf7bf96b399bffb898217211f39192f129a13a..1f112bc62279aefa8177a737ca528411a5196fe2 100644 (file)
@@ -59,6 +59,7 @@
 #include <syslog.h>                    /* closelog() */
 #include <signal.h>
 #include <stdarg.h>
+#include <syslog.h>
 
 /* Utility libraries. */
 
@@ -66,8 +67,8 @@
 #include <binhash.h>
 #include <mymalloc.h>
 #include <events.h>
+#include <vstring.h>
 #include <argv.h>
-#include <syslog.h>
 
 /* Application-specific. */
 
@@ -136,9 +137,13 @@ void    master_spawn(MASTER_SERV *serv)
     MASTER_PROC *proc;
     MASTER_PID pid;
     int     n;
+    static unsigned master_generation = 0;
+    static VSTRING *env_gen = 0;
 
     if (master_child_table == 0)
        master_child_table = binhash_create(0);
+    if (env_gen == 0)
+       env_gen = vstring_alloc(100);
 
     /*
      * Sanity checks. The master_avail module is supposed to know what it is
@@ -155,6 +160,7 @@ void    master_spawn(MASTER_SERV *serv)
      * Create a child process and connect parent and child via the status
      * pipe.
      */
+    master_generation += 1;
     switch (pid = fork()) {
 
        /*
@@ -207,6 +213,10 @@ void    master_spawn(MASTER_SERV *serv)
                          myname, serv->listen_fd[n]);
            (void) close(serv->listen_fd[n]);
        }
+       vstring_sprintf(env_gen, "%s=%o", MASTER_GEN_NAME, master_generation);
+       if (putenv(vstring_str(env_gen)) < 0)
+           msg_fatal("%s: putenv: %m", myname);
+
        execvp(serv->path, serv->args->argv);
        msg_fatal("%s: exec %s: %m", myname, serv->path);
        exit(1);
@@ -224,6 +234,7 @@ void    master_spawn(MASTER_SERV *serv)
        proc = (MASTER_PROC *) mymalloc(sizeof(MASTER_PROC));
        proc->serv = serv;
        proc->pid = pid;
+       proc->gen = master_generation;
        proc->use_count = 0;
        proc->avail = 0;
        binhash_enter(master_child_table, (char *) &pid,
index de0cc4d28c3152dfbe89d3268ec837fdfaf36f2d..dabde1f9db7faf242233a338b29d331c2066d37f 100644 (file)
@@ -89,13 +89,15 @@ static void master_status_event(int event, char *context)
        /* NOTREACHED */
 
     default:
-       msg_warn("%s: partial status (%d bytes)", myname, n);
+       msg_warn("service %s: child (pid %d) sent partial status update (%d bytes)", 
+                serv->name, stat.pid, n);
        return;
 
     case sizeof(stat):
        pid = stat.pid;
        if (msg_verbose)
-           msg_info("%s: pid %d avail %d", myname, stat.pid, stat.avail);
+           msg_info("%s: pid %d gen %u avail %d",
+                    myname, stat.pid, stat.gen, stat.avail);
     }
 
     /*
@@ -111,6 +113,11 @@ static void master_status_event(int event, char *context)
            msg_info("%s: process id not found: %d", myname, stat.pid);
        return;
     }
+    if (proc->gen != stat.gen) {
+       msg_info("ignoring status update from child pid %d generation %u",
+                pid, stat.gen);
+       return;
+    }
     if (proc->serv != serv)
        msg_panic("%s: pointer corruption: %p != %p",
                  myname, (void *) proc->serv, (void *) serv);
index 396c0aebcac1795438a4fcc0cf0e745bb3fa8065..f6f873f3cb0d6c0dee87923215a03e2dfdc8f560 100644 (file)
 #include <signal.h>
 #include <syslog.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <string.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -205,6 +206,7 @@ static void (*multi_server_onexit) (char *, char **);
 static void (*multi_server_pre_accept) (char *, char **);
 static VSTREAM *multi_server_lock;
 static int multi_server_in_flow_delay;
+static unsigned multi_server_generation;
 static void (*multi_server_pre_disconn) (VSTREAM *, char *, char **);
 
 /* multi_server_exit - normal termination */
@@ -263,10 +265,10 @@ static void multi_server_execute(int unused_event, char *context)
      * Do not bother the application when the client disconnected.
      */
     if (peekfd(vstream_fileno(stream)) > 0) {
-       if (master_notify(var_pid, MASTER_STAT_TAKEN) < 0)
+       if (master_notify(var_pid, multi_server_generation, MASTER_STAT_TAKEN) < 0)
            multi_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
        multi_server_service(stream, multi_server_name, multi_server_argv);
-       if (master_notify(var_pid, MASTER_STAT_AVAIL) < 0)
+       if (master_notify(var_pid, multi_server_generation, MASTER_STAT_AVAIL) < 0)
            multi_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
     } else {
        multi_server_disconnect(stream);
@@ -406,6 +408,7 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...)
     int     zerolimit = 0;
     WATCHDOG *watchdog;
     char   *oval;
+    char   *generation;
 
     /*
      * Process environment options as early as we can.
@@ -597,6 +600,15 @@ NORETURN multi_server_main(int argc, char **argv, MULTI_SERVER_FN service,...)
            msg_fatal("unsupported transport type: %s", transport);
     }
 
+    /*
+     * Retrieve process generation from environment.
+     */
+    if ((generation = getenv(MASTER_GEN_NAME)) != 0) {
+       if (!alldig(generation))
+           msg_fatal("bad generation: %s", generation);
+       multi_server_generation = strtoul(generation, (char **) 0, 8);
+    }
+
     /*
      * Optionally start the debugger on ourself.
      */
index c2feb94a65ac1fbbe78c33d767610d2214d9ae01..11c045317f1fd882e937241bd3a2b1b585d7756b 100644 (file)
 #include <signal.h>
 #include <syslog.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <string.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -193,6 +194,7 @@ static void (*single_server_onexit) (char *, char **);
 static void (*single_server_pre_accept) (char *, char **);
 static VSTREAM *single_server_lock;
 static int single_server_in_flow_delay;
+static unsigned single_server_generation;
 
 /* single_server_exit - normal termination */
 
@@ -243,13 +245,13 @@ static void single_server_wakeup(int fd)
     vstream_control(stream, VSTREAM_CTL_PATH, tmp, VSTREAM_CTL_END);
     myfree(tmp);
     timed_ipc_setup(stream);
-    if (master_notify(var_pid, MASTER_STAT_TAKEN) < 0)
+    if (master_notify(var_pid, single_server_generation, MASTER_STAT_TAKEN) < 0)
        single_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
     if (single_server_in_flow_delay && mail_flow_get(1) < 0)
        doze(var_in_flow_delay * 1000000);
     single_server_service(stream, single_server_name, single_server_argv);
     (void) vstream_fclose(stream);
-    if (master_notify(var_pid, MASTER_STAT_AVAIL) < 0)
+    if (master_notify(var_pid, single_server_generation, MASTER_STAT_AVAIL) < 0)
        single_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
     if (msg_verbose)
        msg_info("connection closed");
@@ -352,6 +354,7 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...)
     int     zerolimit = 0;
     WATCHDOG *watchdog;
     char   *oval;
+    char   *generation;
 
     /*
      * Process environment options as early as we can.
@@ -540,6 +543,15 @@ NORETURN single_server_main(int argc, char **argv, SINGLE_SERVER_FN service,...)
            msg_fatal("unsupported transport type: %s", transport);
     }
 
+    /*
+     * Retrieve process generation from environment.
+     */
+    if ((generation = getenv(MASTER_GEN_NAME)) != 0) {
+       if (!alldig(generation))
+           msg_fatal("bad generation: %s", generation);
+       single_server_generation = strtoul(generation, (char **) 0, 8);
+    }
+
     /*
      * Optionally start the debugger on ourself.
      */
index e7640ed2f2ffb88d29716316fc8be9b3350ad22a..3681fbd7459080bc64c41bd61ead1011e94c7d89 100644 (file)
 #include <signal.h>
 #include <syslog.h>
 #include <stdlib.h>
+#include <limits.h>
 #include <string.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -200,6 +201,7 @@ static void (*trigger_server_onexit) (char *, char **);
 static void (*trigger_server_pre_accept) (char *, char **);
 static VSTREAM *trigger_server_lock;
 static int trigger_server_in_flow_delay;
+static unsigned trigger_server_generation;
 
 /* trigger_server_exit - normal termination */
 
@@ -238,14 +240,14 @@ static void trigger_server_wakeup(int fd)
     /*
      * Commit suicide when the master process disconnected from us.
      */
-    if (master_notify(var_pid, MASTER_STAT_TAKEN) < 0)
+    if (master_notify(var_pid, trigger_server_generation, MASTER_STAT_TAKEN) < 0)
        trigger_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
     if (trigger_server_in_flow_delay && mail_flow_get(1) < 0)
        doze(var_in_flow_delay * 1000000);
     if ((len = read(fd, buf, sizeof(buf))) >= 0)
        trigger_server_service(buf, len, trigger_server_name,
                               trigger_server_argv);
-    if (master_notify(var_pid, MASTER_STAT_AVAIL) < 0)
+    if (master_notify(var_pid, trigger_server_generation, MASTER_STAT_AVAIL) < 0)
        trigger_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
     if (var_idle_limit > 0)
        event_request_timer(trigger_server_timeout, (char *) 0, var_idle_limit);
@@ -348,6 +350,7 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,..
     int     zerolimit = 0;
     WATCHDOG *watchdog;
     char   *oval;
+    char   *generation;
 
     /*
      * Process environment options as early as we can.
@@ -550,6 +553,15 @@ NORETURN trigger_server_main(int argc, char **argv, TRIGGER_SERVER_FN service,..
            msg_fatal("unsupported transport type: %s", transport);
     }
 
+    /*
+     * Retrieve process generation from environment.
+     */
+    if ((generation = getenv(MASTER_GEN_NAME)) != 0) {
+       if (!alldig(generation))
+           msg_fatal("bad generation: %s", generation);
+       trigger_server_generation = strtoul(generation, (char **) 0, 8);
+    }
+
     /*
      * Optionally start the debugger on ourself.
      */
index 090b0f24f4e46e7b725a71488c908532a1adce06..17bee1f436921a227581fcf914c9fd952928ba3d 100644 (file)
@@ -638,7 +638,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
     if (message->sasl_sender == 0)
        message->sasl_sender = mystrdup("");
     if (message->rewrite_context == 0)
-       message->rewrite_context = mystrdup("");
+       message->rewrite_context = mystrdup(MAIL_ATTR_RWR_LOCAL);
 
     /*
      * Clean up.
index a8ddf94a6b96de27525410724752bb0bf3fda2b5..84c8e4cc283f4aa87fd8f9725b214654c31a231f 100644 (file)
@@ -288,14 +288,6 @@ static int pickup_copy(VSTREAM *qfile, VSTREAM *cleanup,
     if (*var_filter_xport)
        rec_fprintf(cleanup, REC_TYPE_FILT, "%s", var_filter_xport);
 
-    /*
-     * Origin is local.
-     */
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_ORIGIN, MAIL_ATTR_ORG_LOCAL);
-    rec_fprintf(cleanup, REC_TYPE_ATTR, "%s=%s",
-               MAIL_ATTR_RWR_CONTEXT, MAIL_ATTR_RWR_LOCAL);
-
     /*
      * Copy the message envelope segment. Allow only those records that we
      * expect to see in the envelope section. The envelope segment must
index 49c8bfd7902980730cad1b6b44577f4ea34ab3c9..4444cc58e8f240f899f89401ccc60fb01e34bfdb 100644 (file)
 /*     trivial-rewrite(8), address routing
 /*     bounce(8), delivery status reports
 /*     postconf(5), configuration parameters
+/*     master(5), generic daemon options
 /*     master(8), process manager
 /*     syslogd(8) system logging
 /* README FILES
index 17d2f2de28fedda71101eaab0dd8f32f3d418404..0c6ba062cf534967ac82d1841f58b5e5086e8047 100644 (file)
@@ -673,7 +673,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
     if (message->sasl_sender == 0)
        message->sasl_sender = mystrdup("");
     if (message->rewrite_context == 0)
-       message->rewrite_context = mystrdup("");
+       message->rewrite_context = mystrdup(MAIL_ATTR_RWR_LOCAL);
 
     /*
      * Clean up.
index 63a878a1a7cea05072f6d67cec6a2a5974732a56..0ecc7140e3bccc94dba216f683834e0ab28f278e 100644 (file)
 /*     bounce(8), delivery status reports
 /*     scache(8), connection cache server
 /*     postconf(5), configuration parameters
+/*     master(5), generic daemon options
 /*     master(8), process manager
 /*     syslogd(8), system logging
 /* README FILES
index ce1410feff15cffe9d7fe7f73ce47e97187d843c..444d7f8bf6d81204da0d7ed3f2d599579ad29a39 100644 (file)
 /*     Request that the Postfix SMTP server rejects mail for unknown
 /*     recipient addresses, even when no explicit reject_unlisted_recipient
 /*     access restriction is specified.
+/* .PP
+/*     Available in Postfix version 2.2 and later:
+/* .IP "\fBsmtpd_end_of_data_restrictions (empty)\fR"
+/*     Optional access restrictions that the Postfix SMTP server
+/*     applies in the context of the SMTP END-OF-DATA command.
 /* SENDER AND RECIPIENT ADDRESS VERIFICATION CONTROLS
 /* .ad
 /* .fi
 /*     trivial-rewrite(8), address resolver
 /*     verify(8), address verification service
 /*     postconf(5), configuration parameters
+/*     master(5), generic daemon options
 /*     master(8), process manager
 /*     syslogd(8), system logging
 /* README FILES
@@ -715,6 +721,7 @@ char   *var_mail_checks;
 char   *var_rcpt_checks;
 char   *var_etrn_checks;
 char   *var_data_checks;
+char   *var_eod_checks;
 int     var_unk_client_code;
 int     var_bad_name_code;
 int     var_unk_name_code;
@@ -1388,6 +1395,7 @@ static int mail_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
 static void mail_reset(SMTPD_STATE *state)
 {
     state->msg_size = 0;
+    state->act_size = 0;
 
     /*
      * Unceremoniously close the pipe to the cleanup service. The cleanup
@@ -1758,10 +1766,23 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
        if (prev_rec_type != REC_TYPE_CONT && *start == '.'
            && (state->proxy == 0 ? (++start, --len) == 0 : len == 1))
            break;
+       state->act_size += len + 2;
        if (state->err == CLEANUP_STAT_OK
            && out_record(out_stream, curr_rec_type, start, len) < 0)
            state->err = out_error;
     }
+    state->where = SMTPD_AFTER_DOT;
+    if (SMTPD_STAND_ALONE(state) == 0 && (err = smtpd_check_eod(state)) != 0) {
+       smtpd_chat_reply(state, "%s", err);
+       if (state->proxy) {
+           smtpd_proxy_close(state);
+       } else {
+           mail_stream_cleanup(state->dest);
+           state->dest = 0;
+           state->cleanup = 0;
+       }
+       return (-1);
+    }
 
     /*
      * Send the end of DATA and finish the proxy connection. Set the
@@ -1846,12 +1867,6 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
        smtpd_chat_reply(state, "451 Error: internal error %d", state->err);
     }
 
-    /*
-     * Disconnect after transmission must not be treated as "lost connection
-     * after DATA".
-     */
-    state->where = SMTPD_AFTER_DOT;
-
     /*
      * Cleanup. The client may send another MAIL command.
      */
@@ -2884,6 +2899,7 @@ int     main(int argc, char **argv)
        VAR_RCPT_CHECKS, DEF_RCPT_CHECKS, &var_rcpt_checks, 0, 0,
        VAR_ETRN_CHECKS, DEF_ETRN_CHECKS, &var_etrn_checks, 0, 0,
        VAR_DATA_CHECKS, DEF_DATA_CHECKS, &var_data_checks, 0, 0,
+       VAR_EOD_CHECKS, DEF_EOD_CHECKS, &var_eod_checks, 0, 0,
        VAR_MAPS_RBL_DOMAINS, DEF_MAPS_RBL_DOMAINS, &var_maps_rbl_domains, 0, 0,
        VAR_RBL_REPLY_MAPS, DEF_RBL_REPLY_MAPS, &var_rbl_reply_maps, 0, 0,
        VAR_ERROR_RCPT, DEF_ERROR_RCPT, &var_error_rcpt, 1, 0,
index 232c3a02ad5c438144ae06d283538a302788572b..442bbc1c77cebc976f1d5db75f803ed333555520 100644 (file)
@@ -86,6 +86,7 @@ typedef struct SMTPD_STATE {
     char   *where;                     /* protocol stage */
     int     recursion;                 /* Kellerspeicherpegelanzeiger */
     off_t   msg_size;                  /* MAIL FROM message size */
+    off_t   act_size;                  /* END-OF-DATA message size */
     int     junk_cmds;                 /* counter */
     int     rcpt_overshoot;            /* counter */
     char   *rewrite_context;           /* address rewriting context */
index f8e04a768d042a9394e37b062c2dc0c9a1c85cb5..5966ebceec153f0bd497726f427e6664b2752b2e 100644 (file)
@@ -36,6 +36,9 @@
 /*
 /*     char    *smtpd_check_data(state)
 /*     SMTPD_STATE *state;
+/*
+/*     char    *smtpd_check_eod(state)
+/*     SMTPD_STATE *state;
 /* DESCRIPTION
 /*     This module implements additional checks on SMTP client requests.
 /*     A client request is validated in the context of the session state.
 /*     smtpd_check_data() enforces generic restrictions after the
 /*     client has sent the DATA command.
 /*
+/*     smtpd_check_eod() enforces generic restrictions after the
+/*     client has sent the END-OF-DATA command.
+/*
 /*     Arguments:
 /* .IP name
 /*     The client hostname, or \fIunknown\fR.
@@ -292,6 +298,7 @@ static ARGV *mail_restrctions;
 static ARGV *rcpt_restrctions;
 static ARGV *etrn_restrctions;
 static ARGV *data_restrctions;
+static ARGV *eod_restrictions;
 
 static HTABLE *smtpd_rest_classes;
 static HTABLE *policy_clnt_table;
@@ -324,6 +331,7 @@ static int check_rcpt_maps(SMTPD_STATE *, const char *, const char *);
 #define SMTPD_NAME_RECIPIENT   "Recipient address"
 #define SMTPD_NAME_ETRN                "Etrn command"
 #define SMTPD_NAME_DATA                "Data command"
+#define SMTPD_NAME_EOD         "End-of-data"
 
  /*
   * YASLM.
@@ -651,6 +659,8 @@ void    smtpd_check_init(void)
                                         var_etrn_checks);
     data_restrctions = smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
                                         var_data_checks);
+    eod_restrictions = smtpd_check_parse(SMTPD_CHECK_PARSE_ALL,
+                                        var_eod_checks);
 
     /*
      * Parse the pre-defined restriction classes.
@@ -2898,7 +2908,8 @@ static int check_policy_service(SMTPD_STATE *state, const char *server,
                          ATTR_TYPE_STR, MAIL_ATTR_INSTANCE,
                          STR(state->instance),
                          ATTR_TYPE_LONG, MAIL_ATTR_SIZE,
-                         (unsigned long) state->msg_size,
+                         (unsigned long) (state->act_size > 0 ?
+                                        state->act_size : state->msg_size),
 #ifdef USE_SASL_AUTH
                          ATTR_TYPE_STR, MAIL_ATTR_SASL_METHOD,
                          var_smtpd_sasl_enable && state->sasl_method ?
@@ -3395,6 +3406,7 @@ void    smtpd_check_rewrite(SMTPD_STATE *state)
     int     status;
     char  **cpp;
     DICT   *dict;
+    char   *name;
 
     /*
      * We don't use generic_checks() because it produces results that aren't
@@ -3404,29 +3416,33 @@ void    smtpd_check_rewrite(SMTPD_STATE *state)
        if (msg_verbose)
            msg_info("%s: trying: %s", myname, *cpp);
        status = SMTPD_CHECK_DUNNO;
-       if (strcasecmp(*cpp, PERMIT_MYNETWORKS) == 0) {
+       if (strchr(name = *cpp, ':') != 0) {
+           name = CHECK_ADDR_MAP;
+           cpp -= 1;
+       }
+       if (strcasecmp(name, PERMIT_MYNETWORKS) == 0) {
            status = permit_mynetworks(state);
-       } else if (is_map_command(state, *cpp, CHECK_ADDR_MAP, &cpp)) {
-           if ((dict = dict_handle(*cpp)) == 0)
-               msg_panic("%s: dictionary not found: %s", myname, *cpp);
+       } else if (is_map_command(state, name, CHECK_ADDR_MAP, &cpp)) {
+           if ((dict = dict_handle(name)) == 0)
+               msg_panic("%s: dictionary not found: %s", myname, name);
            if (dict_get(dict, state->addr) != 0)
                status = SMTPD_CHECK_OK;
-       } else if (strcasecmp(*cpp, PERMIT_SASL_AUTH) == 0) {
+       } else if (strcasecmp(name, PERMIT_SASL_AUTH) == 0) {
 #ifdef USE_SASL_AUTH
            status = permit_sasl_auth(state, SMTPD_CHECK_OK,
                                      SMTPD_CHECK_DUNNO);
 #else
            status = SMTPD_CHECK_DUNNO;
 #endif
-#ifdef USE_SSL
-       } else if (strcasecmp(*cpp, PERMIT_TLS_ALL_CLIENTCERTS) == 0) {
+#ifdef USE_TLS
+       } else if (strcasecmp(name, PERMIT_TLS_ALL_CLIENTCERTS) == 0) {
            status = permit_tls_clientcerts(state, 1);
-       } else if (strcasecmp(*cpp, PERMIT_TLS_CLIENTCERTS) == 0) {
+       } else if (strcasecmp(name, PERMIT_TLS_CLIENTCERTS) == 0) {
            status = permit_tls_clientcerts(state, 0);
 #endif
        } else {
            msg_warn("parameter %s: invalid request: %s",
-                    VAR_LOC_RWR_CLIENTS, *cpp);
+                    VAR_LOC_RWR_CLIENTS, name);
            continue;
        }
        if (status == SMTPD_CHECK_OK) {
@@ -4002,6 +4018,55 @@ char   *smtpd_check_data(SMTPD_STATE *state)
     return (status == SMTPD_CHECK_REJECT ? STR(error_text) : 0);
 }
 
+/* smtpd_check_eod - check end-of-data command */
+
+char   *smtpd_check_eod(SMTPD_STATE *state)
+{
+    int     status;
+    char   *NOCLOBBER saved_recipient;
+
+    /*
+     * Minor kluge so that we can delegate work to the generic routine. We
+     * provide no recipient information in the case of multiple recipients,
+     * This restriction applies to all recipients alike, and logging only one
+     * of them would be misleading.
+     */
+    if (state->rcpt_count > 1) {
+       saved_recipient = state->recipient;
+       state->recipient = 0;
+    }
+
+    /*
+     * Reset the defer_if_permit flag. This is necessary when some recipients
+     * were accepted but the last one was rejected.
+     */
+    state->defer_if_permit.active = 0;
+
+    /*
+     * Apply restrictions in the order as specified.
+     * 
+     * XXX We cannot specify a default target for a bare access map.
+     */
+    SMTPD_CHECK_RESET();
+    status = setjmp(smtpd_check_buf);
+    if (status == 0 && eod_restrictions->argc)
+       status = generic_checks(state, eod_restrictions,
+                               "END-OF-DATA", SMTPD_NAME_EOD, NO_DEF_ACL);
+
+    /*
+     * Force permission into deferral when some earlier temporary error may
+     * have prevented us from rejecting mail, and report the earlier problem.
+     */
+    if (status != SMTPD_CHECK_REJECT && state->defer_if_permit.active)
+       status = smtpd_check_reject(state, state->defer_if_permit.class,
+                                 "%s", STR(state->defer_if_permit.reason));
+
+    if (state->rcpt_count > 1)
+       state->recipient = saved_recipient;
+
+    return (status == SMTPD_CHECK_REJECT ? STR(error_text) : 0);
+}
+
 #ifdef TEST
 
  /*
index 8d706bb9a9a60d20113d3e09e19371cfec151336..6850db737876ffa96691a4317a0271bbe11c6a17 100644 (file)
@@ -22,6 +22,7 @@ extern char *smtpd_check_size(SMTPD_STATE *, off_t);
 extern char *smtpd_check_rcpt(SMTPD_STATE *, char *);
 extern char *smtpd_check_etrn(SMTPD_STATE *, char *);
 extern char *smtpd_check_data(SMTPD_STATE *);
+extern char *smtpd_check_eod(SMTPD_STATE *);
 extern char *smtpd_check_policy(SMTPD_STATE *, char *);
 
 /* LICENSE
index 759f5ebfd52c926626991d857c5aacf8bd8ef7a0..e51739f851cbe5577128242b4f7f88e20f86faeb 100644 (file)
@@ -95,6 +95,7 @@ void    smtpd_state_init(SMTPD_STATE *state, VSTREAM *stream,
     state->where = SMTPD_AFTER_CONNECT;
     state->recursion = 0;
     state->msg_size = 0;
+    state->act_size = 0;
     state->junk_cmds = 0;
     state->rcpt_overshoot = 0;
     state->defer_if_permit_client = 0;
index 51c63cde6138ff6517c01a39472b01c48e6fb835..91b3a57b549a61d4e086e95269c5e714254fafea 100644 (file)
@@ -473,8 +473,10 @@ const char *dict_eval(const char *dict_name, const char *value, int recursive)
      */
     if (buf == 0)
        buf = vstring_alloc(10);
-    if (loop++ == 0)
+    if (loop++ == 0) {
        VSTRING_RESET(buf);
+       VSTRING_TERMINATE(buf);
+    }
     ctxt.buf = buf;
     ctxt.recursive = recursive;
     ctxt.dict_name = dict_name;