]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.2.7 v2.2.7
authorWietse Venema <wietse@porcupine.org>
Thu, 8 Dec 2005 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sat, 10 Feb 2018 21:11:43 +0000 (16:11 -0500)
postfix/HISTORY
postfix/src/global/deliver_pass.c
postfix/src/global/mail_version.h
postfix/src/lmtp/lmtp.c
postfix/src/lmtp/lmtp.h
postfix/src/lmtp/lmtp_proto.c
postfix/src/scache/scache.c

index d17c89855c8dd8cdec6328193350797a819ea9f5..d325405a4a6936fabec8c69c3650151111f9eff9 100644 (file)
@@ -10730,3 +10730,25 @@ Apologies for any names omitted.
        be fixed; it must be specified before the message content
        is received.  Files: smtpd/smtpd.c, smtpd/smtpd_check.c,
        cleanup/cleanup_extracted.c, pickup/pickup.c.
+
+20051201
+
+       Bugfix: the LMTP client would reuse a session after negative
+       reply to the RSET command (which may happen when client and
+       server somehow get out of sync). Problem found by Christian
+       Theune.  Files: lmtp/lmtp.c, lmtp/lmtp_proto.c.
+
+20051207
+
+       Bugfix: race condition in the connection caching protocol,
+       causing the SMTP delivery agent to hang after delivering
+       mail, while trying to save a connection. Introduced with
+       Postfix 2.2.5.  Files: scache/scache.c.
+
+20051208
+
+       Bugfix: the best_mx_transport, mailbox_transport and
+       fallback_transport features did not write a per-recipient
+       defer logfile record when the target delivery agent was
+       broken.  This the analog of queue manager bugfix 20051119.
+       Files: global/deliver_pass.c.
index e9a2b08079f20a7320ab560684f5b260ab2696f6..0e6081be55ecddd8858b14af40555a4fc80f0d50 100644 (file)
@@ -72,6 +72,9 @@
 #include <mail_params.h>
 #include <deliver_pass.h>
 
+#define DELIVER_PASS_DEFER     1
+#define DELIVER_PASS_UNKNOWN   2
+
 /* deliver_pass_initial_reply - retrieve initial delivery process response */
 
 static int deliver_pass_initial_reply(VSTREAM *stream)
@@ -141,9 +144,10 @@ static int deliver_pass_final_reply(VSTREAM *stream, VSTRING *reason)
                  ATTR_TYPE_NUM, MAIL_ATTR_STATUS, &stat,
                  ATTR_TYPE_END) != 2) {
        msg_warn("%s: malformed response", VSTREAM_PATH(stream));
-       stat = -1;
+       return (DELIVER_PASS_UNKNOWN);
+    } else {
+       return (stat ? DELIVER_PASS_DEFER : 0);
     }
-    return (stat);
 }
 
 /* deliver_pass - deliver one per-site queue entry */
@@ -185,10 +189,20 @@ int     deliver_pass(const char *class, const char *service,
      * XXX Can't pass back hop status info because the problem is with a
      * different transport.
      */
-    if ((status = deliver_pass_initial_reply(stream)) == 0
-       && (status = deliver_pass_send_request(stream, request, nexthop,
-                                              orig_addr, addr, offs)) == 0)
-       status = deliver_pass_final_reply(stream, reason);
+    if (deliver_pass_initial_reply(stream) != 0
+       || deliver_pass_send_request(stream, request, nexthop,
+                                    orig_addr, addr, offs) != 0) {
+       status = defer_append(DEL_REQ_TRACE_FLAGS(request->flags),
+                             request->queue_id, orig_addr, addr,
+                             offs, "none", request->arrival_time,
+                             "mail transport unavailable");
+    } else if ((status = deliver_pass_final_reply(stream, reason))
+              == DELIVER_PASS_UNKNOWN) {
+       status = defer_append(DEL_REQ_TRACE_FLAGS(request->flags),
+                             request->queue_id, orig_addr, addr,
+                             offs, "none", request->arrival_time,
+                             "unknown mail transport error");
+    }
 
     /*
      * Clean up.
index f402600a1e0518dde7f1382fe20996e04e658178..e3ced8a030ea2dd130353d5c300a5b023dc9d325 100644 (file)
@@ -20,8 +20,8 @@
   * Patches change the patchlevel and the release date. Snapshots change the
   * release date only.
   */
-#define MAIL_RELEASE_DATE      "20051130"
-#define MAIL_VERSION_NUMBER    "2.2.6"
+#define MAIL_RELEASE_DATE      "20051208"
+#define MAIL_VERSION_NUMBER    "2.2.7"
 
 #define VAR_MAIL_VERSION       "mail_version"
 #ifdef SNAPSHOT
index e9078e551e605eadd0fdea0af2e1eebe4784f37c..763c052299c7f4314f85b25c6f7d6a14a0aea3b2 100644 (file)
@@ -365,7 +365,8 @@ static int deliver_message(DELIVER_REQUEST *request, char **unused_argv)
         * Disconnect if RSET can't be sent over an existing connection.
         * Discard transcript and status information for sending RSET.
         */
-       else if (lmtp_rset(state) != 0) {
+       else if (lmtp_rset(state) != 0
+                || (state->features & LMTP_FEATURE_RSET_REJECTED) != 0) {
            lmtp_chat_reset(state);
            state->session = lmtp_session_free(state->session);
 #ifdef USE_SASL_AUTH
index 2c30226c489d2907c111194fdaaa12085ae06400..31a3b9066ca56f36e44f40ee20b632483a9681b4 100644 (file)
@@ -66,6 +66,7 @@ typedef struct LMTP_STATE {
 #define LMTP_FEATURE_XFORWARD_PROTO (1<<8)
 #define LMTP_FEATURE_XFORWARD_HELO (1<<9)
 #define LMTP_FEATURE_XFORWARD_DOMAIN (1<<10)
+#define LMTP_FEATURE_RSET_REJECTED (1<<11)
 
  /*
   * lmtp.c
index ebfa6323d7ac50e4163009036f8b76772527b494..cdc318952177006a20461916e35518ae6d00d1fc 100644 (file)
@@ -31,6 +31,7 @@
 /*     accordingly.
 /*
 /*     lmtp_rset() sends a lone RSET command and waits for the response.
+/*     In case of a negative reply it sets the CANT_RSET_THIS_SESSION flag.
 /*
 /*     lmtp_quit() sends a lone QUIT command and waits for the response
 /*     only if waiting for QUIT replies is enabled.
@@ -354,6 +355,9 @@ static int lmtp_loop(LMTP_STATE *state, NOCLOBBER int send_state,
 #define SENDING_MAIL \
        (recv_state <= LMTP_STATE_DOT)
 
+#define CANT_RSET_THIS_SESSION \
+       (state->features |= LMTP_FEATURE_RSET_REJECTED)
+
     /*
      * Pipelining support requires two loops: one loop for sending and one
      * for receiving. Each loop has its own independent state. Most of the
@@ -734,6 +738,8 @@ static int lmtp_loop(LMTP_STATE *state, NOCLOBBER int send_state,
                     * Ignore the RSET response.
                     */
                case LMTP_STATE_RSET:
+                   if (resp->code / 100 != 2)
+                       CANT_RSET_THIS_SESSION;
                    recv_state = LMTP_STATE_LAST;
                    break;
 
index deb6f0dad5da671e30a0b7d8aae846784344b3e5..4046b64243d19618463456c491a4b8ad73d0672e 100644 (file)
@@ -422,6 +422,7 @@ static void scache_service(VSTREAM *client_stream, char *unused_service,
      * dedicated to the scache service. All connection-management stuff is
      * handled by the common code in multi_server.c.
      */
+do {
     if (attr_scan(client_stream,
                  ATTR_FLAG_MORE | ATTR_FLAG_STRICT,
                  ATTR_TYPE_STR, MAIL_ATTR_REQ, scache_request,
@@ -442,6 +443,7 @@ static void scache_service(VSTREAM *client_stream, char *unused_service,
                       ATTR_TYPE_END);
        }
     }
+} while (vstream_peek(client_stream) > 0);
     vstream_fflush(client_stream);
 }