]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.8-20100323
authorWietse Venema <wietse@porcupine.org>
Tue, 23 Mar 2010 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:36:09 +0000 (06:36 +0000)
19 files changed:
postfix/HISTORY
postfix/README_FILES/MILTER_README
postfix/WISHLIST
postfix/html/MILTER_README.html
postfix/html/master.5.html
postfix/html/postcat.1.html
postfix/html/postconf.5.html
postfix/man/man1/postcat.1
postfix/man/man5/master.5
postfix/man/man5/postconf.5
postfix/proto/MILTER_README.html
postfix/proto/master
postfix/proto/postconf.proto
postfix/src/global/dsn_mask.c
postfix/src/global/mail_version.h
postfix/src/milter/milter8.c
postfix/src/milter/test-milter.c
postfix/src/postcat/postcat.c
postfix/src/smtp/smtp.c

index 52daefc20237fa7a52f97834c00153456bfb942a..0dd53715b04b6d0d181bf072e515923f9b2b03ac 100644 (file)
@@ -15599,7 +15599,7 @@ Apologies for any names omitted.
        server will not wait (up to 6 seconds) for the address
        verification result. File: global/mail_params.h.
 
-       Final slution for the I/O event starvation problem when a
+       Final solution for the I/O event starvation problem when a
        timer call-back schedules a zero-delay timer request.  File:
        util/events.c.
 
@@ -15739,5 +15739,18 @@ Apologies for any names omitted.
        Feature: smtp_address_preference (default: ipv6) to control
        the order in which the Postfix SMTP client will connect to
        a destination that has IPv6 and IPv4 addresses with equal
-       MX preference. Files: global/mail_params.c, smtp/smtp.c,
-       smtp/smtp_params.c, smtp/smtp_addr.c, proto/postconf.proto.
+       MX preference. Files: global/mail_params.h, smtp/smtp.c,
+       smtp/smtp_params.c, smtp/smtp_addr.c, dns/dns_rr.c,
+       and documentation.
+
+20100321
+
+       Feature: allow Milter applications to use a lower protocol
+       version than the version that Postfix is configured for.
+       Based on an idea by Kouhei Sutou.  File: milter/milter8.c.
+
+20100322
+
+       Bugfix (introduced 20100305) the new smtp_address_preference
+       feature was not tested with LMTP support. Problem reported
+       by Stefan Foerster. File: smtp/smtp.c.
index 87996fe3f4586fb04db55a4bebd7f3e4e6078d83..084ea4de5395c3713d0ab6a7ee361deb25e33473 100644 (file)
@@ -277,16 +277,18 @@ The remedy is to increase the Postfix milter_protocol version number. See,
 however, the limitations section below for features that aren't supported by
 Postfix.
 
-If the Postfix milter_protocol setting specifies a too high version, the
-libmilter library simply hangs up without logging a warning, and you see a
-Postfix warning message like one of the following:
+With Postfix 2.7 and earlier, if the Postfix milter_protocol setting specifies
+a too high version, the libmilter library simply hangs up without logging a
+warning, and you see a Postfix warning message like one of the following:
 
     warning: milter inet:host:port: can't read packet header: Unknown error : 0
     warning: milter inet:host:port: can't read packet header: Success
     warning: milter inet:host:port: can't read SMFIC_DATA reply packet header:
     No such file or directory
 
-The remedy is to lower the Postfix milter_protocol version number.
+The remedy is to lower the Postfix milter_protocol version number. Postfix 2.8
+and later will automatically turn off protocol features that the application's
+libmilter library does not expect.
 
 M\bMi\bil\blt\bte\ber\br p\bpr\bro\bot\bto\boc\bco\bol\bl t\bti\bim\bme\beo\bou\but\bts\bs
 
index bb3e2d6e0842acbf0eb5939246ad31a700d4cdd3..064ad644a927290ae08f65f5050336b3355d15f2 100644 (file)
@@ -2,9 +2,28 @@ Wish list:
 
        Remove this file from the stable release.
 
-       Add smtpd_sender_login_maps to proxy_read_maps. What other 
-       parameters are worthy of being whitelisted for proxy access?
-       Is there a way to automate this decision?
+       Add some checks for tokens starting with #. A challenge
+       is to report sensible context from the guts of some low-level
+       parser, without introducing a great deal of clumsiness.
+
+       Add sendmail macros for {verify} and maybe other TLS info.
+
+       Find out if we are doing the correct thing by looking at
+       state->milter_reject_text when expanding {rcpt_addr} or
+       {rcpt_host}.
+
+       Find out why post_mail() etc. block when the qmgr fifo 
+       is full. This causes delays in the queue manager.
+
+       Add smtpd_sender_login_maps to proxy_read_maps, and make
+       sure that defaults are set before proxy_read_maps is
+       evaluated. What other parameters are worthy of being
+       whitelisted for proxy access?  Is there a way to automate
+       this decision?
+
+       How to ensure that proxy_read_maps is processed after all
+       its dependencies are initialized, or just bite the bullet
+       and rewrite the parameter initialization code.
 
        The cleanup virtual alias expansion limit does not really
        deliver on its promises. 1) It promises to truncate the
index f4f7512ef5a3e8ef8b51b9b8f00b3ea37c6f0f40..bb5a385906d610d0171ee87a10b68d46a88a7567 100644 (file)
@@ -466,7 +466,8 @@ version, the libmilter library will log an error message like this:
 number.  See, however, the <a href="#limitations">limitations</a>
 section below for features that aren't supported by Postfix. </p>
 
-<p> If the Postfix <a href="postconf.5.html#milter_protocol">milter_protocol</a> setting specifies a too high
+<p> With Postfix 2.7 and earlier, if the Postfix <a href="postconf.5.html#milter_protocol">milter_protocol</a>
+setting specifies a too high
 version, the libmilter library simply hangs up without logging a
 warning, and you see a Postfix warning message like one of the
 following: </p>
@@ -480,7 +481,9 @@ warning: milter inet:<i>host</i>:<i>port</i>: can't read SMFIC_DATA reply packet
 </blockquote>
 
 <p> The remedy is to lower the Postfix <a href="postconf.5.html#milter_protocol">milter_protocol</a> version
-number. </p>
+number. Postfix 2.8 and later will automatically turn off protocol
+features that the application's libmilter library does not expect.
+</p>
 
 <h3><a name="timeouts">Milter protocol timeouts</a></h3>
 
index e28361305850b0179a0440cd7c13281fec0a7799..adfd46b6f5ea9d2741dc3f56ac2676480ab3408d 100644 (file)
@@ -110,9 +110,9 @@ MASTER(5)                                                            MASTER(5)
                      tion parameter in <a href="postconf.5.html">main.cf</a>).
 
               <b>pass</b>   The service listens on a UNIX-domain socket,
-                     receives one open connection (file  descrip-
-                     tor  passing) per connection request, and is
-                     accessible to local clients only.
+                     and is accessible to local clients only.  It
+                     receives  one open connection (file descrip-
+                     tor passing) per connection request.
 
                      The service name is a pathname  relative  to
                      the  Postfix  queue directory (pathname con-
index 52a2eb7da4a357511a565578bd3536176f4191da..de3ef5d18df7dc1eb13fc3cdd83de1dc2bffbb4c 100644 (file)
@@ -20,7 +20,7 @@ POSTCAT(1)                                                          POSTCAT(1)
 
        By default, <a href="postcat.1.html"><b>postcat</b>(1)</a> shows the envelope and message con-
        tent,  as if the options <b>-beh</b> were specified. To view mes-
-       sage content only, specify <b>-bh</b> (Postfix 2.7 and later).
+       sage headers only, specify <b>-bh</b> (Postfix 2.7 and later).
 
        Options:
 
index f245be210607b94bd454b851de88a238a10c7c85..a41f426fb1229a33eb783facd06beb20589051a4 100644 (file)
@@ -283,7 +283,7 @@ of an address verification request in progress.
 
 <p> By default, the Postfix SMTP server polls the <a href="verify.8.html">verify(8)</a> service
 up to three times under non-overload conditions, and only once when
-under overload.  With Postfix version 2.6 and earlier, the SMTP
+under overload.  With Postfix version 2.5 and earlier, the SMTP
 server always polls the <a href="verify.8.html">verify(8)</a> service up to three times by
 default.  </p>
 
@@ -11400,6 +11400,13 @@ part before delivering the mail. </p>
     /^RCPT\s+TO:\s*&lt;'([^[:space:]]+)'&gt;(.*)/     RCPT TO:&lt;$1&gt;$2
 </pre>
 
+<pre>
+    # Bounce-never mail sink. Use <a href="postconf.5.html#notify_classes">notify_classes</a>=bounce,resource,software
+    # to send bounced mail to the postmaster (with message body removed).
+    /^(RCPT\s+TO:.*?)\bNOTIFY=\S+\b(.*)/ $1 NOTIFY=NEVER $2
+    /^(RCPT\s+TO:.*)/                    $1 NOTIFY=NEVER
+</pre>
+
 <p> This feature is available in Postfix 2.7. </p>
 
 
index bf01c06c4cb0ea7b11a1b2f28fbb11ec2638537b..57aacb9d502f680817d5faf0991d6956faa77d01 100644 (file)
@@ -20,7 +20,7 @@ standard input.
 
 By default, \fBpostcat\fR(1) shows the envelope and message
 content, as if the options \fB-beh\fR were specified. To
-view message content only, specify \fB-bh\fR (Postfix 2.7
+view message headers only, specify \fB-bh\fR (Postfix 2.7
 and later).
 
 Options:
index 4148063534e776e9b1be866ffca2f68f084ad7dd..3df5cf9d1375c3c17a1e9bcc89f8eed71b1dd564 100644 (file)
@@ -102,9 +102,9 @@ The service name is a pathname relative to the Postfix
 queue directory (pathname controlled with the \fBqueue_directory\fR
 configuration parameter in main.cf).
 .IP \fBpass\fR
-The service listens on a UNIX-domain socket, receives one
-open connection (file descriptor passing) per connection
-request, and is accessible to local clients only.
+The service listens on a UNIX-domain socket, and is accessible
+to local clients only. It receives one open connection (file
+descriptor passing) per connection request.
 
 The service name is a pathname relative to the Postfix
 queue directory (pathname controlled with the \fBqueue_directory\fR
index ce8c539719ad5e68680f89da1cd8fdb62eb73481..aeadd20bd25f047eec12bcae8f57b39916a8c3e6 100644 (file)
@@ -163,7 +163,7 @@ of an address verification request in progress.
 .PP
 By default, the Postfix SMTP server polls the \fBverify\fR(8) service
 up to three times under non-overload conditions, and only once when
-under overload.  With Postfix version 2.6 and earlier, the SMTP
+under overload.  With Postfix version 2.5 and earlier, the SMTP
 server always polls the \fBverify\fR(8) service up to three times by
 default.
 .PP
@@ -7039,6 +7039,17 @@ Examples:
 .ad
 .ft R
 .PP
+.nf
+.na
+.ft C
+    # Bounce-never mail sink. Use notify_classes=bounce,resource,software
+    # to send bounced mail to the postmaster (with message body removed).
+    /^(RCPT\es+TO:.*?)\ebNOTIFY=\eS+\eb(.*)/ $1 NOTIFY=NEVER $2
+    /^(RCPT\es+TO:.*)/                    $1 NOTIFY=NEVER
+.fi
+.ad
+.ft R
+.PP
 This feature is available in Postfix 2.7.
 .SH smtpd_data_restrictions (default: empty)
 Optional access restrictions that the Postfix SMTP server applies
index 7bd2a71353424521d2f8d3dcab0756374585d79f..5e3a5085753e8d0fbfac17fa9cbe3ee0cdf81dcf 100644 (file)
@@ -466,7 +466,8 @@ version, the libmilter library will log an error message like this:
 number.  See, however, the <a href="#limitations">limitations</a>
 section below for features that aren't supported by Postfix. </p>
 
-<p> If the Postfix milter_protocol setting specifies a too high
+<p> With Postfix 2.7 and earlier, if the Postfix milter_protocol
+setting specifies a too high
 version, the libmilter library simply hangs up without logging a
 warning, and you see a Postfix warning message like one of the
 following: </p>
@@ -480,7 +481,9 @@ warning: milter inet:<i>host</i>:<i>port</i>: can't read SMFIC_DATA reply packet
 </blockquote>
 
 <p> The remedy is to lower the Postfix milter_protocol version
-number. </p>
+number. Postfix 2.8 and later will automatically turn off protocol
+features that the application's libmilter library does not expect.
+</p>
 
 <h3><a name="timeouts">Milter protocol timeouts</a></h3>
 
index 15b82f4e20d8e7b040d3feedb786cd31a6590356..3d3f07bc96f48294ed1b4a2f3e019c6fb7ba90b6 100644 (file)
@@ -96,9 +96,9 @@
 #      queue directory (pathname controlled with the \fBqueue_directory\fR
 #      configuration parameter in main.cf).
 # .IP \fBpass\fR
-#      The service listens on a UNIX-domain socket, receives one
-#      open connection (file descriptor passing) per connection
-#      request, and is accessible to local clients only.
+#      The service listens on a UNIX-domain socket, and is accessible
+#      to local clients only. It receives one open connection (file
+#      descriptor passing) per connection request.
 #
 #      The service name is a pathname relative to the Postfix
 #      queue directory (pathname controlled with the \fBqueue_directory\fR
index 5a88698f400c726503a4a9f4af5065ef01ad2c5c..ad076c7c6be39a78788b0c8013499a9d164fd75a 100644 (file)
@@ -310,7 +310,7 @@ of an address verification request in progress.
 
 <p> By default, the Postfix SMTP server polls the verify(8) service
 up to three times under non-overload conditions, and only once when
-under overload.  With Postfix version 2.6 and earlier, the SMTP
+under overload.  With Postfix version 2.5 and earlier, the SMTP
 server always polls the verify(8) service up to three times by
 default.  </p>
 
@@ -12736,6 +12736,13 @@ part before delivering the mail. </p>
     /^RCPT\s+TO:\s*&lt;'([^[:space:]]+)'&gt;(.*)/     RCPT TO:&lt;$1&gt;$2
 </pre>
 
+<pre>
+    # Bounce-never mail sink. Use notify_classes=bounce,resource,software 
+    # to send bounced mail to the postmaster (with message body removed).
+    /^(RCPT\s+TO:.*?)\bNOTIFY=\S+\b(.*)/ $1 NOTIFY=NEVER $2
+    /^(RCPT\s+TO:.*)/                    $1 NOTIFY=NEVER
+</pre>
+
 <p> This feature is available in Postfix 2.7. </p>
 
 %PARAM smtp_reply_filter 
index 3c183aa4af507fa297d494ac59451442bebd7cb8..8485be17f45a47cb61343d56cffa8587dbd171da 100644 (file)
@@ -29,7 +29,7 @@
 /*     NOTIFY option to internal form.
 /*
 /*     dsn_notify_str() converts internal form to the representation
-/*     used in the MAIL FROM .. NOTIFY command. The result is in
+/*     used in the RCPT TO .. NOTIFY command. The result is in
 /*     volatile memory and is clobbered whenever str_name_mask()
 /*     is called.
 /*
index 01f2bf60536c86394aba113cb8879a090843d223..92835492f4e1fe617e08d6aca164a819a3668cbb 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      "20100306"
+#define MAIL_RELEASE_DATE      "20100323"
 #define MAIL_VERSION_NUMBER    "2.8"
 
 #ifdef SNAPSHOT
index 6fea0f06a18d03cea3d932f2f29bec34cd93e5d5..3aa5cbb972a0035cb5080c7a3772a892950c2c88 100644 (file)
@@ -209,7 +209,7 @@ static const NAME_CODE smfir_table[] = {
 #define SMFIP_NOUNKNOWN        (1L<<8) /* filter does not want unknown cmd */
 #define SMFIP_NODATA           (1L<<9) /* filter does not want DATA */
  /* Introduced with Sendmail 8.14. */
-#define SMFIP_SKIP             (1L<<10)/* MTA supports SMFIS_SKIP */
+#define SMFIP_SKIP             (1L<<10)/* MTA supports SMFIR_SKIP */
 #define SMFIP_RCPT_REJ         (1L<<11)/* filter wants rejected RCPTs */
 #define SMFIP_NR_CONN          (1L<<12)/* filter won't reply for connect */
 #define SMFIP_NR_HELO          (1L<<13)/* filter won't reply for HELO */
@@ -444,12 +444,15 @@ typedef struct {
   * 
   * XXX Is this still needed? Sendmail 8.14 provides a proper way to negotiate
   * what replies the mail filter will send.
+  * 
+  * XXX Keep this table in reverse numerical order. This is needed by the code
+  * that implements compatibility with older Milter protocol versions.
   */
 static const NAME_CODE milter8_event_masks[] = {
-    "2", MILTER8_V2_PROTO_MASK,
-    "3", MILTER8_V3_PROTO_MASK,
-    "4", MILTER8_V4_PROTO_MASK,
     "6", MILTER8_V6_PROTO_MASK,
+    "4", MILTER8_V4_PROTO_MASK,
+    "3", MILTER8_V3_PROTO_MASK,
+    "2", MILTER8_V2_PROTO_MASK,
     "no_header_reply", SMFIP_NOHREPL,
     0, -1,
 };
@@ -1775,6 +1778,41 @@ static void milter8_connect(MILTER8 *milter)
     if (milter->ev_mask & SMFIP_RCPT_REJ)
        milter->m.flags |= MILTER_FLAG_WANT_RCPT_REJ;
 
+    /*
+     * Allow the remote application to run an older protocol version, but
+     * don't them send events that their protocol version doesn't support.
+     * Based on a suggestion by Kouhei Sutou.
+     * 
+     * XXX When the Milter sends a protocol version that we don't have
+     * information for, use the information for the next-lower protocol
+     * version instead. This code assumes that the milter8_event_masks table
+     * is organized in reverse numerical order.
+     */
+    if (milter->version < my_version) {
+       const NAME_CODE *np;
+       int     version;
+
+       for (np = milter8_event_masks; /* see below */ ; np++) {
+           if (np->name == 0) {
+               msg_warn("milter %s: unexpected protocol version %d",
+                        milter->m.name, milter->version);
+               break;
+           }
+           if ((version = atoi(np->name)) > 0 && version <= milter->version) {
+               milter->np_mask |= (SMFIP_NOSEND_MASK & ~np->code);
+               if (msg_verbose)
+                   msg_info("%s: non-protocol events for milter %s"
+                            " protocol version %d: %s",
+                            myname, milter->m.name, milter->version,
+                            str_name_mask_opt(milter->buf,
+                                              "non-protocol event mask",
+                                              smfip_table, milter->np_mask,
+                                              NAME_MASK_NUMBER));
+               break;
+           }
+       }
+    }
+
     /*
      * Initial negotiations completed.
      */
index 2fa88c81a3788a7eb26c942144472ca9b60212f3..69e83bc77aa2ba79188fbedbcf454c338bc0f406 100644 (file)
@@ -397,11 +397,23 @@ static sfsistat test_unknown(SMFICTX *ctx, const char *what)
 
 #endif
 
+#if SMFI_VERSION > 5
+
 static sfsistat test_negotiate(SMFICTX *, unsigned long, unsigned long,
                                       unsigned long, unsigned long,
                                       unsigned long *, unsigned long *,
                                       unsigned long *, unsigned long *);
 
+#endif
+
+#ifndef SMFIF_CHGFROM
+#define SMFIF_CHGFROM 0
+#endif
+#ifndef SMFIP_HDR_LEADSPC
+#define SMFIP_HDR_LEADSPC 0
+#define misc_mask 0
+#endif
+
 static struct smfiDesc smfilter =
 {
     "test-milter",
index 7c687bfe4f9f28daf96b7f1d1fc1d1826c99fc18..62f85fee9c84816ecd4b9da8b1b25331c6399e28 100644 (file)
@@ -14,7 +14,7 @@
 /*
 /*     By default, \fBpostcat\fR(1) shows the envelope and message
 /*     content, as if the options \fB-beh\fR were specified. To
-/*     view message content only, specify \fB-bh\fR (Postfix 2.7
+/*     view message headers only, specify \fB-bh\fR (Postfix 2.7
 /*     and later).
 /*
 /*     Options:
index e00c91d3392b549f11a2bec5f02f980b8f040d1c..3cf74660cbc1c3750daa3db288a905db471a1c97 100644 (file)
@@ -864,7 +864,7 @@ static int deliver_message(const char *service, DELIVER_REQUEST *request)
     state->request = request;
     state->src = request->fp;
     state->service = service;
-    state->misc_flags = smtp_addr_pref;
+    state->misc_flags |= smtp_addr_pref;
     SMTP_RCPT_INIT(state);
 
     /*