]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.3-20051212
authorWietse Venema <wietse@porcupine.org>
Mon, 12 Dec 2005 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:31:53 +0000 (06:31 +0000)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/smtp/smtp_proto.c

index e0498678a07cea0b4f14d031f9565d3f1e99348a..ebce17863248baafc060d04373a0a80091d9be42 100644 (file)
@@ -11549,6 +11549,16 @@ Apologies for any names omitted.
        logic for address list and fallback relay processing.
        Still need to simplify deferred recipient handling.
 
+20051210
+
+       Bugfix: after a failed TLS session, the 20051210 SMTP client
+       code cleanup broke sessions with backup servers, causing the
+       client to get out of step with the backup server.  This in
+       turn exposed a one-year old missing exception handling
+       context in the EHLO handstake after sending STARTTLS. Victim
+       was Ralf Hildebrandt, detectives Victor Duchovni and Wietse.
+       File: smtp/smtp_proto.c.
+
 Open problems:
 
        "postsuper -r" no longer resets the message arrival time,
index 3fbce5fe7b02184801b01a9f49d3b478ac10b7d5..317e55d5c595d66b196e18e9e3b8c149c1d37397 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      "20051210"
+#define MAIL_RELEASE_DATE      "20051212"
 #define MAIL_VERSION_NUMBER    "2.3"
 
 #ifdef SNAPSHOT
index c8adb4c4c4d35b8c1f2618fbfd95a519afe57c53..bb92a2000afddfa7808202af64e1b766c0fbdcba 100644 (file)
@@ -260,8 +260,17 @@ int     smtp_helo(SMTP_STATE *state)
 
 #ifdef USE_TLS
     int     saved_features = session->features;
+    int     tls_helo_status;
 
 #endif
+    const char *NOCLOBBER where;
+
+    /*
+     * Prepare for disaster.
+     */
+    smtp_timeout_setup(state->session->stream, var_smtp_helo_tmout);
+    if ((except = vstream_setjmp(state->session->stream)) != 0)
+       return (smtp_stream_except(state, except, where));
 
     /*
      * If not recursing after STARTTLS, examine the server greeting banner
@@ -269,17 +278,10 @@ int     smtp_helo(SMTP_STATE *state)
      */
     if ((state->misc_flags & SMTP_MISC_FLAG_IN_STARTTLS) == 0) {
 
-       /*
-        * Prepare for disaster.
-        */
-       smtp_timeout_setup(state->session->stream, var_smtp_helo_tmout);
-       if ((except = vstream_setjmp(state->session->stream)) != 0)
-           return (smtp_stream_except(state, except,
-                                 "receiving the initial server greeting"));
-
        /*
         * Read and parse the server's SMTP greeting banner.
         */
+       where = "receiving the initial server greeting";
        switch ((resp = smtp_chat_resp(session))->code / 100) {
        case 2:
            break;
@@ -343,12 +345,14 @@ int     smtp_helo(SMTP_STATE *state)
      * heuristic failed.
      */
     if ((state->misc_flags & SMTP_MISC_FLAG_USE_LMTP) == 0) {
+       where = "performing the EHLO handshake";
        if (session->features & SMTP_FEATURE_ESMTP) {
            smtp_chat_cmd(session, "EHLO %s", var_smtp_helo_name);
            if ((resp = smtp_chat_resp(session))->code / 100 != 2)
                session->features &= ~SMTP_FEATURE_ESMTP;
        }
        if ((session->features & SMTP_FEATURE_ESMTP) == 0) {
+           where = "performing the HELO handshake";
            smtp_chat_cmd(session, "HELO %s", var_smtp_helo_name);
            if ((resp = smtp_chat_resp(session))->code / 100 != 2)
                return (smtp_site_fail(state, session->host, resp,
@@ -358,6 +362,7 @@ int     smtp_helo(SMTP_STATE *state)
            return (0);
        }
     } else {
+       where = "performing the LHLO handshake";
        smtp_chat_cmd(session, "LHLO %s", var_smtp_helo_name);
        if ((resp = smtp_chat_resp(session))->code / 100 != 2)
            return (smtp_site_fail(state, session->host, resp,
@@ -541,8 +546,11 @@ int     smtp_helo(SMTP_STATE *state)
                }
 #endif
                session->features = saved_features;
+               /* XXX Mix-up of per-session and per-request flags. */
                state->misc_flags |= SMTP_MISC_FLAG_IN_STARTTLS;
-               return (smtp_start_tls(state));
+               tls_helo_status = smtp_start_tls(state);
+               state->misc_flags &= ~SMTP_MISC_FLAG_IN_STARTTLS;
+               return (tls_helo_status);
            }
 
            /*