]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.12-20140209
authorWietse Venema <wietse@porcupine.org>
Sun, 9 Feb 2014 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Mon, 10 Feb 2014 03:52:31 +0000 (22:52 -0500)
17 files changed:
postfix/HISTORY
postfix/README_FILES/FORWARD_SECRECY_README
postfix/html/FORWARD_SECRECY_README.html
postfix/html/postconf.1.html
postfix/makedefs
postfix/man/man1/postconf.1
postfix/proto/FORWARD_SECRECY_README.html
postfix/src/global/mail_version.h
postfix/src/global/rcpt_print.c
postfix/src/milter/milter_macros.c
postfix/src/postconf/postconf.c
postfix/src/smtp/Makefile.in
postfix/src/smtp/smtp.h
postfix/src/smtp/smtp_connect.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtp/smtp_trouble.c
postfix/src/smtpd/smtpd_check.c

index 8482b6195ebf125a4e10ffc3aec882729e833d6b..da3b242d2cfe60ee0122a7bed5c3167285d83966 100644 (file)
@@ -19528,3 +19528,23 @@ Apologies for any names omitted.
 20140110-15
 
        Miscellaneous documentation cleanups.
+
+20140116
+
+       Workaround: prepend "-I. -I../../include" to CCARGS, to
+       avoid name clashes with non-Postfix header files. File:
+       makedefs.
+
+20140125
+
+       Cleanup: assorted documentation glitches.
+
+20140209
+
+       Workaround: the Postfix SMTP client now also falls back to
+       plaintext when TLS fails after the TLS protocol handshake.
+       Files: smtp/smtp.h, smtp/smtp_connect.c, smtp/smtp_trouble.c.
+
+       Testbed: unsupported HANGUP access map action that drops
+       the connection without responding to the remote SMTP client.
+       File: smtpd/smtpd_check.c.
index b81bfcbea53f7f3808b30b1df812dd5848ce7975..8d6fa3dac84f598f2976685b0004c8b2af288d81 100644 (file)
@@ -181,12 +181,13 @@ main.cf.
 F\bFo\bor\brw\bwa\bar\brd\bd S\bSe\bec\bcr\bre\bec\bcy\by i\bin\bn t\bth\bhe\be P\bPo\bos\bst\btf\bfi\bix\bx S\bSM\bMT\bTP\bP C\bCl\bli\bie\ben\bnt\bt
 
 The Postfix >= 2.2 SMTP client supports forward secrecy in its default
-configuration. No configuration changes are needed besides turning on elliptic-
-curve support with Postfix 2.6 and 2.7 (see the quick-start section). If the
-remote SMTP server supports cipher suites with forward secrecy (and does not
-override the SMTP client's cipher preference), then the traffic between the
-server and client will resist decryption even if the server's long-term
-authentication keys are later compromised.
+configuration. All supported OpenSSL releases support EDH key exchange. OpenSSL
+releases >= 1.0.0 also support EECDH key exchange (provided elliptic-curve
+support has not been disabled by the vendor as in some versions of RedHat
+Linux). If the remote SMTP server supports cipher suites with forward secrecy
+(and does not override the SMTP client's cipher preference), then the traffic
+between the server and client will resist decryption even if the server's long-
+term authentication keys are later compromised.
 
 The default Postfix SMTP client cipher lists are correctly ordered to prefer
 EECDH and EDH cipher suites ahead of similar cipher suites that don't implement
@@ -200,12 +201,16 @@ a case-by-case basis via the TLS policy table.
 
 G\bGe\bet\btt\bti\bin\bng\bg s\bst\bta\bar\brt\bte\bed\bd,\b, q\bqu\bui\bic\bck\bk a\ban\bnd\bd d\bdi\bir\brt\bty\by
 
-E\bEE\bEC\bCD\bDH\bH C\bCl\bli\bie\ben\bnt\bt a\ban\bnd\bd s\bse\ber\brv\bve\ber\br s\bsu\bup\bpp\bpo\bor\brt\bt (\b(P\bPo\bos\bst\btf\bfi\bix\bx >\b>=\b= 2\b2.\b.6\b6 w\bwi\bit\bth\bh O\bOp\bpe\ben\bnS\bSS\bSL\bL >\b>=\b= 1\b1.\b.0\b0.\b.0\b0)\b)
+E\bEE\bEC\bCD\bDH\bH C\bCl\bli\bie\ben\bnt\bt s\bsu\bup\bpp\bpo\bor\brt\bt (\b(P\bPo\bos\bst\btf\bfi\bix\bx >\b>=\b= 2\b2.\b.2\b2 w\bwi\bit\bth\bh O\bOp\bpe\ben\bnS\bSS\bSL\bL >\b>=\b= 1\b1.\b.0\b0.\b.0\b0)\b)
+
+This works "out of the box" without additional configuration.
+
+E\bEE\bEC\bCD\bDH\bH S\bSe\ber\brv\bve\ber\br s\bsu\bup\bpp\bpo\bor\brt\bt (\b(P\bPo\bos\bst\btf\bfi\bix\bx >\b>=\b= 2\b2.\b.6\b6 w\bwi\bit\bth\bh O\bOp\bpe\ben\bnS\bSS\bSL\bL >\b>=\b= 1\b1.\b.0\b0.\b.0\b0)\b)
 
 With Postfix 2.6 and 2.7, enable elliptic-curve support in the Postfix SMTP
-client and server. This is the default with Postfix >= 2.8. Note, however, that
-elliptic-curve support may be disabled by the vendor, as in some versions of
-RedHat Linux.
+server. This is the default with Postfix >= 2.8. Note, however, that elliptic-
+curve support may be disabled by the vendor, as in some versions of RedHat
+Linux.
 
     /etc/postfix/main.cf:
         # Postfix 2.6 or 2.7 only. This is default with Postfix 2.8 and later.
index af0f53d1574da7c4cf8c4c34f9a0ddd8cf350848..1e0adc0e107a771718fffebb445aa441cb2ba883 100644 (file)
@@ -253,9 +253,10 @@ more curves at the desired security level without any changes to
 <h2> <a name="client_fs">Forward Secrecy in the Postfix SMTP Client</a> </h2>
 
 <p> The Postfix &ge; 2.2 SMTP client supports forward secrecy in
-its default configuration.  No configuration changes are needed
-besides turning on elliptic-curve support with Postfix 2.6 and 2.7
-(see the <a href="#quick-start"> quick-start</a> section).  If the
+its default configuration.  All supported OpenSSL releases support
+EDH key exchange.  OpenSSL releases &ge; 1.0.0 also support EECDH
+key exchange (provided elliptic-curve support has not been disabled
+by the vendor as in some versions of RedHat Linux).  If the
 remote SMTP server supports cipher suites with forward secrecy (and
 does not override the SMTP client's cipher preference), then the
 traffic between the server and client will resist decryption even
@@ -277,11 +278,14 @@ href="TLS_README.html#client_tls_policy">TLS policy</a> table. </p>
 
 <h2><a name="quick-start">Getting started, quick and dirty</a></h2>
 
-<h3> EECDH Client and server support (Postfix &ge; 2.6 with OpenSSL
-&ge; 1.0.0) </h3>
+<h3> EECDH Client support (Postfix &ge; 2.2 with OpenSSL &ge; 1.0.0) </h3>
+
+<p> This works "out of the box" without additional configuration. </p>
+
+<h3> EECDH Server support (Postfix &ge; 2.6 with OpenSSL &ge; 1.0.0) </h3>
 
 <p> With Postfix 2.6 and 2.7, enable elliptic-curve support in the
-Postfix SMTP client and server. This is the default with Postfix
+Postfix SMTP server. This is the default with Postfix
 &ge; 2.8. Note, however, that elliptic-curve support may be disabled
 by the vendor, as in some versions of RedHat Linux. </p>
 
index ecaed1a2555c69fbb71171c350d8487795aa0aaf..aa16a13a45f48c759b33e6fd96c463e13f3d4ef0 100644 (file)
@@ -123,6 +123,8 @@ POSTCONF(1)                                                        POSTCONF(1)
 
               The default is as if "<b>-C all</b>" is specified.
 
+              This feature is available with Postfix 2.9 and later.
+
        <b>-d</b>     Print  <a href="postconf.5.html"><b>main.cf</b></a> default parameter settings instead of actual set-
               tings.  Specify <b>-df</b> to fold long  lines  for  human  readability
               (Postfix 2.9 and later).
@@ -330,6 +332,8 @@ POSTCONF(1)                                                        POSTCONF(1)
 
        <b>-p</b>     Show <a href="postconf.5.html"><b>main.cf</b></a> parameter settings. This is the default.
 
+              This feature is available with Postfix 2.11 and later.
+
        <b>-P</b>     Show  <a href="master.5.html"><b>master.cf</b></a>  service parameter settings (by default all ser-
               vices   and   all   parameters).    formatted   as   one   "<i>ser-</i>
               <i>vice/type/parameter=value</i>"  per  line.  Specify <b>-Pf</b> to fold long
@@ -444,8 +448,10 @@ POSTCONF(1)                                                        POSTCONF(1)
        The Secure Mailer license must be distributed with this software.
 
 <b>AUTHOR(S)</b>
-       Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown
-       Heights, NY 10598, USA
+       Wietse Venema
+       IBM T.J. Watson Research
+       P.O. Box 704
+       Yorktown Heights, NY 10598, USA
 
                                                                    POSTCONF(1)
 </pre> </body> </html>
index 7ea559081d6a7b87d396786cc5c1d14ac1e797f5..5f3bcc7474835b76ee462eb312768685cffb5cd9 100644 (file)
@@ -638,6 +638,9 @@ CCARGS="$CCARGS -DSNAPSHOT"
 # needed before the code stabilizes.
 #CCARGS="$CCARGS -DNONPROD"
 
+# Workaround: prepend Postfix include files before other include files.
+CCARGS="-I. -I../../include $CCARGS"
+
 sed 's/  / /g' <<EOF
 SYSTYPE        = $SYSTYPE
 AR     = $AR
index 59631d0361713a7cbed3fa4894b3bb20b494a500..07784d596a4ab6920c2a751574014489a0c92cc4 100644 (file)
@@ -143,6 +143,8 @@ All the above classes.
 .IP
 The default is as if "\fB-C all\fR" is
 specified.
+
+This feature is available with Postfix 2.9 and later.
 .IP \fB-d\fR
 Print \fBmain.cf\fR default parameter settings instead of
 actual settings.
@@ -347,6 +349,8 @@ Override \fBmain.cf\fR parameter settings.
 This feature is available with Postfix 2.10 and later.
 .IP \fB-p\fR
 Show \fBmain.cf\fR parameter settings. This is the default.
+
+This feature is available with Postfix 2.11 and later.
 .IP \fB-P\fR
 Show \fBmaster.cf\fR service parameter settings (by default
 all services and all parameters).  formatted as one
@@ -486,5 +490,7 @@ software.
 .SH "AUTHOR(S)"
 .na
 .nf
-Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown
-Heights, NY 10598, USA
+Wietse Venema
+IBM T.J. Watson Research
+P.O. Box 704
+Yorktown Heights, NY 10598, USA
index ec30b2fb32320443c735a0d4e9ef5bd4f3a7393c..99f3033619ea205e2eb495eaa6cd6a35b5c9ead2 100644 (file)
@@ -253,9 +253,10 @@ main.cf. </p>
 <h2> <a name="client_fs">Forward Secrecy in the Postfix SMTP Client</a> </h2>
 
 <p> The Postfix &ge; 2.2 SMTP client supports forward secrecy in
-its default configuration.  No configuration changes are needed
-besides turning on elliptic-curve support with Postfix 2.6 and 2.7
-(see the <a href="#quick-start"> quick-start</a> section).  If the
+its default configuration.  All supported OpenSSL releases support
+EDH key exchange.  OpenSSL releases &ge; 1.0.0 also support EECDH
+key exchange (provided elliptic-curve support has not been disabled
+by the vendor as in some versions of RedHat Linux).  If the
 remote SMTP server supports cipher suites with forward secrecy (and
 does not override the SMTP client's cipher preference), then the
 traffic between the server and client will resist decryption even
@@ -277,11 +278,14 @@ href="TLS_README.html#client_tls_policy">TLS policy</a> table. </p>
 
 <h2><a name="quick-start">Getting started, quick and dirty</a></h2>
 
-<h3> EECDH Client and server support (Postfix &ge; 2.6 with OpenSSL
-&ge; 1.0.0) </h3>
+<h3> EECDH Client support (Postfix &ge; 2.2 with OpenSSL &ge; 1.0.0) </h3>
+
+<p> This works "out of the box" without additional configuration. </p>
+
+<h3> EECDH Server support (Postfix &ge; 2.6 with OpenSSL &ge; 1.0.0) </h3>
 
 <p> With Postfix 2.6 and 2.7, enable elliptic-curve support in the
-Postfix SMTP client and server. This is the default with Postfix
+Postfix SMTP server. This is the default with Postfix
 &ge; 2.8. Note, however, that elliptic-curve support may be disabled
 by the vendor, as in some versions of RedHat Linux. </p>
 
index 9c60fe76edcc5475b842028c02f427112eaa7920..459a55f99f90cbcc0abd7a8ffd3b46bdacea938d 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      "20140115"
+#define MAIL_RELEASE_DATE      "20140209"
 #define MAIL_VERSION_NUMBER    "2.12"
 
 #ifdef SNAPSHOT
index 1c8b0cfa7f62ab8d70b85ada888951808760239d..c98809cc42bbc358d9d713490f8fdf6023025b5d 100644 (file)
 /*     The Secure Mailer license must be distributed with this
 /*     software.
 /* AUTHOR(S)
-/*     Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown
-/*     Heights, NY 10598, USA
+/*     Wietse Venema
+/*     IBM T.J. Watson Research
+/*     P.O. Box 704
+/*     Yorktown Heights, NY 10598, USA
 /*--*/
 
 /* System library. */
index b62f32be78e012aa632bf92cec9f81b90a08b72c..c54eed941c8dc0e8e7c66ca757be015c0a637eee 100644 (file)
 /*     The Secure Mailer license must be distributed with this
 /*     software.
 /* AUTHOR(S)
-/*     Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown
-/*     Heights, NY 10598, USA
+/*     Wietse Venema
+/*     IBM T.J. Watson Research
+/*     P.O. Box 704
+/*     Yorktown Heights, NY 10598, USA
 /*--*/
 
 /* System library. */
index df8ab4d45923c0e66be8aa440c404c240ced41b3..23bcbb082eff1228b578eda00676b2786e78c7ff 100644 (file)
 /* .IP
 /*     The default is as if "\fB-C all\fR" is
 /*     specified.
+/*
+/*     This feature is available with Postfix 2.9 and later.
 /* .IP \fB-d\fR
 /*     Print \fBmain.cf\fR default parameter settings instead of
 /*     actual settings.
 /*     This feature is available with Postfix 2.10 and later.
 /* .IP \fB-p\fR
 /*     Show \fBmain.cf\fR parameter settings. This is the default.
+/*
+/*     This feature is available with Postfix 2.11 and later.
 /* .IP \fB-P\fR
 /*     Show \fBmaster.cf\fR service parameter settings (by default
 /*     all services and all parameters).  formatted as one
 /*     The Secure Mailer license must be distributed with this
 /*     software.
 /* AUTHOR(S)
-/*     Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown
-/*     Heights, NY 10598, USA
+/*     Wietse Venema
+/*     IBM T.J. Watson Research
+/*     P.O. Box 704
+/*     Yorktown Heights, NY 10598, USA
 /*--*/
 
 /* System library. */
index 6be38f833a329568c26986f20959dda7ba08a89d..e5013e4a2e9ced942b43f67a81d0aae8aaf52b9c 100644 (file)
@@ -728,6 +728,7 @@ smtp_trouble.o: ../../include/vbuf.h
 smtp_trouble.o: ../../include/vstream.h
 smtp_trouble.o: ../../include/vstring.h
 smtp_trouble.o: smtp.h
+smtp_trouble.o: smtp_sasl.h
 smtp_trouble.o: smtp_trouble.c
 smtp_unalias.o: ../../include/argv.h
 smtp_unalias.o: ../../include/attr.h
index 336a4f47fad4182b0a9f151ab65cc7c245faaec3..99ab7391f76a72ccb72af4c007d8f6226c7d0c54 100644 (file)
@@ -453,6 +453,29 @@ extern HBC_CALL_BACKS smtp_hbc_callbacks[];
   * Encapsulate the following so that we don't expose details of of
   * connection management and error handling to the SMTP protocol engine.
   */
+#ifdef USE_SASL_AUTH
+#define HAVE_SASL_CREDENTIALS \
+       (var_smtp_sasl_enable \
+            && *var_smtp_sasl_passwd \
+            && smtp_sasl_passwd_lookup(session))
+#else
+#define HAVE_SASL_CREDENTIALS  (0)
+#endif
+
+#define PLAINTEXT_FALLBACK_OK_AFTER_STARTTLS_FAILURE \
+       (session->tls_context == 0 \
+           && session->tls->level == TLS_LEV_MAY \
+           && !HAVE_SASL_CREDENTIALS)
+
+#define PLAINTEXT_FALLBACK_OK_AFTER_TLS_SESSION_FAILURE \
+       (session->tls_context != 0 \
+           && session->tls->level == TLS_LEV_MAY \
+           && !HAVE_SASL_CREDENTIALS)
+
+ /*
+  * XXX The following will not retry recipients that were deferred while the
+  * SMTP_MISC_FLAG_FINAL_SERVER flag was already set.
+  */
 #define RETRY_AS_PLAINTEXT do { \
        session->tls_retry_plain = 1; \
        state->misc_flags &= ~SMTP_MISC_FLAG_FINAL_SERVER; \
index ff278c1ff028e553ba6027a324182d012e55db60..3f7aeea0753f18ffd0012d7010123d349e0a7081 100644 (file)
@@ -1015,6 +1015,19 @@ static void smtp_connect_inet(SMTP_STATE *state, const char *nexthop,
                        && next == 0)
                        state->misc_flags |= SMTP_MISC_FLAG_FINAL_SERVER;
                    smtp_xfer(state);
+#ifdef USE_TLS
+
+                   /*
+                    * When opportunistic TLS fails after the STARTTLS
+                    * handshake, try the same address again, with TLS
+                    * disabled. See also the RETRY_AS_PLAINTEXT macro.
+                    */
+                   if ((retry_plain = session->tls_retry_plain) != 0) {
+                       --sess_count;
+                       --addr_count;
+                       next = addr;
+                   }
+#endif
                }
                smtp_cleanup_session(state);
            } else {
index 1f9759d38acc1dfe2edce5cc8cba7964daec17c5..fbae51f2d597948911a729b639e9ef7d34556708 100644 (file)
@@ -838,13 +838,7 @@ static int smtp_start_tls(SMTP_STATE *state)
         * plaintext connections, then we don't want delivery to fail with
         * "relay access denied".
         */
-       if (session->tls->level == TLS_LEV_MAY
-#ifdef USE_SASL_AUTH
-           && !(var_smtp_sasl_enable
-                && *var_smtp_sasl_passwd
-                && smtp_sasl_passwd_lookup(session))
-#endif
-           )
+       if (PLAINTEXT_FALLBACK_OK_AFTER_STARTTLS_FAILURE)
            RETRY_AS_PLAINTEXT;
        return (smtp_site_fail(state, DSN_BY_LOCAL_MTA,
                               SMTP_RESP_FAKE(&fake, "4.7.5"),
index 4a0c306270e591091a18e9355314733bbc94c91a..c5ed83f29f6016c15c18ae20158031545b64b9e8 100644 (file)
 /* Application-specific. */
 
 #include "smtp.h"
+#include "smtp_sasl.h"
 
 #define SMTP_THROTTLE  1
 #define SMTP_NOTHROTTLE        0
@@ -433,10 +434,18 @@ int     smtp_stream_except(SMTP_STATE *state, int code, const char *description)
     case SMTP_ERR_EOF:
        dsb_simple(why, "4.4.2", "lost connection with %s while %s",
                   session->namaddr, description);
+#ifdef USE_TLS
+       if (PLAINTEXT_FALLBACK_OK_AFTER_TLS_SESSION_FAILURE)
+           RETRY_AS_PLAINTEXT;
+#endif
        break;
     case SMTP_ERR_TIME:
        dsb_simple(why, "4.4.2", "conversation with %s timed out while %s",
                   session->namaddr, description);
+#ifdef USE_TLS
+       if (PLAINTEXT_FALLBACK_OK_AFTER_TLS_SESSION_FAILURE)
+           RETRY_AS_PLAINTEXT;
+#endif
        break;
     case SMTP_ERR_DATA:
        session->error_mask |= MAIL_ERROR_DATA;
index 8d2bd2d63e06f3530d1c8f7e216f7fa8d887a714..8fdcb62fd40838fe34273c7b924d3d5d58fa2ab4 100644 (file)
 #include <dsn_util.h>
 #include <conv_time.h>
 #include <xtext.h>
+#include <smtp_stream.h>
 
 /* Application-specific. */
 
@@ -1068,7 +1069,7 @@ static int permit_inet_interfaces(SMTPD_STATE *state)
     if (msg_verbose)
        msg_info("%s: %s %s", myname, state->name, state->addr);
 
-    if (own_inet_addr((struct sockaddr *) & (state->sockaddr)))
+    if (own_inet_addr((struct sockaddr *) &(state->sockaddr)))
        /* Permit logging in generic_checks() only. */
        return (SMTPD_CHECK_OK);
     return (SMTPD_CHECK_DUNNO);
@@ -2110,6 +2111,22 @@ static int check_table_result(SMTPD_STATE *state, const char *table,
                                   reply_name, reply_class,
                                   *dp.text ? dp.text : "Access denied"));
     }
+#ifndef SHUT_RDWR
+#define SHUT_RDWR   2
+#endif
+
+    /*
+     * HANGUP. Text is optional. Drop the connection without sending any
+     * reply.
+     * 
+     * Note: this is an unsupported test feature. No attempt is made to maintain
+     * compatibility between successive versions.
+     */
+    if (STREQUAL(value, "HANGUP", cmd_len)) {
+       shutdown(vstream_fileno(state->client), SHUT_RDWR);
+       log_whatsup(state, "hangup", cmd_text);
+       vstream_longjmp(state->client, SMTP_ERR_QUIET);
+    }
 
     /*
      * WARN. Text is optional.