]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.4-20061203
authorWietse Venema <wietse@porcupine.org>
Sun, 3 Dec 2006 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:32:41 +0000 (06:32 +0000)
postfix/HISTORY
postfix/README_FILES/ADDRESS_REWRITING_README
postfix/html/ADDRESS_REWRITING_README.html
postfix/proto/ADDRESS_REWRITING_README.html
postfix/src/global/mail_version.h
postfix/src/qmgr/qmgr_job.c
postfix/src/smtp/smtp_connect.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtpd/smtpd_proxy.c
postfix/src/util/vbuf.h
postfix/src/util/vstream.c

index 254e1d15f119d754db71c8b5e36a785cb0ab1cec..bc6e7d1ad982f72744adc9c607ed1ebb1f0a1cfc 100644 (file)
@@ -12862,6 +12862,22 @@ Apologies for any names omitted.
        otherwise they are cut between line boundaries. File:
        cleanup/cleanup_out.c.
 
+20061203
+
+       Bugfix (introduced with Postfix 2.2): with SMTP server
+       tarpit delays of smtp_rset_timeout or larger, the SMTP
+       client could get out of sync with the server while reusing
+       a connection.  The symptoms were "recipient rejected .. in
+       reply to DATA".  Fix by Victor Duchovni and Wietse.  Files:
+       smtp/smtp_proto.c, smtp/smtp_connect.c.
+
+       Robustness: the vbuf and vstream documentation claimed that
+       their *error() macros reported timeout errors, but they
+       didn't really. The implementation was fixed, and redundant
+       vstream_ftimeout() calls were removed. As a result, many
+       Postfix daemons now properly detect write timeout errors
+       on internal connections.  Files: util/vbuf.h.
+
 Wish list:
 
        Investigate if clients of single-instance servers such as
index 4ac6cb4e614f4856a7e8d14acbe6ceded74fc545..b7e75ad5acd53534f758e1e9b3cb56bcd6cfca76 100644 (file)
@@ -831,7 +831,7 @@ no body content so none is shown in the example below.
     Content-Type: message/rfc822
 
     Received: by spike.porcupine.org (Postfix, from userid 1001)
-            id 84863BC0E5; id DA77DBC0A9; Sun, 26 Nov 2006 17:01:01 -0500 (EST)
+            id 84863BC0E5; Sun, 26 Nov 2006 17:01:01 -0500 (EST)
     Subject: probe
     To: postfix-users@postfix.org
     Message-Id: <20061126220101.84863BC0E5@spike.porcupine.org>
index fd580115a35668e70dd3af75e4d76446cab17660..f2243516d26d9b8a98115baa9ccb4627c96ec2af 100644 (file)
@@ -1232,7 +1232,7 @@ Content-Description: Message
 Content-Type: message/rfc822
 
 Received: by spike.porcupine.org (Postfix, from userid 1001)
-        id 84863BC0E5; id DA77DBC0A9; Sun, 26 Nov 2006 17:01:01 -0500 (EST)
+        id 84863BC0E5; Sun, 26 Nov 2006 17:01:01 -0500 (EST)
 Subject: probe
 To: postfix-users@postfix.org
 Message-Id: &lt;20061126220101.84863BC0E5@spike.porcupine.org&gt;
index 21895ae5ec66d12b0dd62158b7e647b7ff8c1dd3..3fef9064348778cf5436b3b6bd5f117aab161049 100644 (file)
@@ -1232,7 +1232,7 @@ Content-Description: Message
 Content-Type: message/rfc822
 
 Received: by spike.porcupine.org (Postfix, from userid 1001)
-        id 84863BC0E5; id DA77DBC0A9; Sun, 26 Nov 2006 17:01:01 -0500 (EST)
+        id 84863BC0E5; Sun, 26 Nov 2006 17:01:01 -0500 (EST)
 Subject: probe
 To: postfix-users@postfix.org
 Message-Id: &lt;20061126220101.84863BC0E5@spike.porcupine.org&gt;
index 50368ed845b2bb21f8dadfb7ee9edfafa17f5f77..bc2d237b6c80a68e3acd66b65e041db8994ee557 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      "20061201"
+#define MAIL_RELEASE_DATE      "20061203"
 #define MAIL_VERSION_NUMBER    "2.4"
 
 #ifdef SNAPSHOT
index cc86d0b464d4c040fc3d398f61e30976a5385522..6318893f443c107f2674bb10146c12eb5e842eb5 100644 (file)
@@ -769,7 +769,7 @@ static QMGR_PEER *qmgr_job_peer_select(QMGR_JOB *job)
      * solution, but that involves major changes.
      */
     if (message->rcpt_offset != 0
-       && message->rcpt_limit > message->rcpt_count - 100
+       && message->rcpt_limit > message->rcpt_count + 100
        && message->refcount > 0) {
        qmgr_message_realloc(message);
     }
index 3f87e7dc3045ca995844e56c9967d88e5276ef28..1430c8ced224e75aa5b30440ca6521b17dcc841b 100644 (file)
@@ -379,7 +379,10 @@ static void smtp_cleanup_session(SMTP_STATE *state)
     bad_session = THIS_SESSION_IS_BAD;         /* smtp_quit() may fail */
     if (THIS_SESSION_IS_EXPIRED)
        smtp_quit(state);                       /* also disables caching */
-    if (THIS_SESSION_IS_CACHED) {
+    if (THIS_SESSION_IS_CACHED
+       /* Redundant tests for safety... */
+       && vstream_ferror(session->stream) == 0
+       && vstream_feof(session->stream) == 0) {
        smtp_save_session(state);
     } else {
        smtp_session_free(session);
index 79fe31e1cc44e830a3c4155024261e8f4ae8383d..bdd46366c232bab9abab64b2d016b42dc81e9c21 100644 (file)
@@ -1041,7 +1041,11 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state,
        } \
     } while (0)
 
+ /* Caution: changes to RETURN() also affect code outside the main loop. */
+
 #define RETURN(x) do { \
+       if (recv_state != SMTP_STATE_LAST) \
+           DONT_CACHE_THIS_SESSION; \
        vstring_free(next_command); \
        if (survivors) \
            myfree((char *) survivors); \
index 0f18fffeebcae273ef29f1236f550f56d88203cf..345485abd30f9e047bf748530201e5c73247fe57 100644 (file)
@@ -458,8 +458,7 @@ int     smtpd_proxy_cmd(SMTPD_STATE *state, int expect, const char *fmt,...)
     /*
      * Errors first. Be prepared for delayed errors from the DATA phase.
      */
-    if (vstream_ftimeout(state->proxy)
-       || vstream_ferror(state->proxy)
+    if (vstream_ferror(state->proxy)
        || vstream_feof(state->proxy)
        || ((err = vstream_setjmp(state->proxy)) != 0
            && smtpd_proxy_rdwr_error(state->proxy, err))) {
@@ -579,8 +578,7 @@ int     smtpd_proxy_rec_put(VSTREAM *stream, int rec_type,
     /*
      * Errors first.
      */
-    if (vstream_ftimeout(stream) || vstream_ferror(stream)
-       || vstream_feof(stream))
+    if (vstream_ferror(stream) || vstream_feof(stream))
        return (REC_TYPE_ERROR);
     if ((err = vstream_setjmp(stream)) != 0)
        return (smtpd_proxy_rdwr_error(stream, err), REC_TYPE_ERROR);
@@ -608,8 +606,7 @@ int     smtpd_proxy_rec_fprintf(VSTREAM *stream, int rec_type,
     /*
      * Errors first.
      */
-    if (vstream_ftimeout(stream) || vstream_ferror(stream)
-       || vstream_feof(stream))
+    if (vstream_ferror(stream) || vstream_feof(stream))
        return (REC_TYPE_ERROR);
     if ((err = vstream_setjmp(stream)) != 0)
        return (smtpd_proxy_rdwr_error(stream, err), REC_TYPE_ERROR);
index d5f4a426c52b4a6ad26a29897e804e40cba3820c..6052b4ed7542c8044c733eab048157de782c56ab 100644 (file)
@@ -65,7 +65,7 @@ struct VBUF {
 #define VBUF_FLAG_BAD  (VBUF_FLAG_ERR | VBUF_FLAG_EOF | VBUF_FLAG_TIMEOUT)
 #define VBUF_FLAG_FIXED        (1<<3)          /* fixed-size buffer */
 
-#define vbuf_error(v)  ((v)->flags & VBUF_FLAG_ERR)
+#define vbuf_error(v)  ((v)->flags & (VBUF_FLAG_ERR | VBUF_FLAG_TIMEOUT))
 #define vbuf_eof(v)    ((v)->flags & VBUF_FLAG_EOF)
 #define vbuf_timeout(v)        ((v)->flags & VBUF_FLAG_TIMEOUT)
 #define vbuf_clearerr(v) ((v)->flags &= ~VBUF_FLAG_BAD)
index ed857b3e3a5fed7c2b2952a272594571e0786b30..1a3373a8eb9d8df24977e21736579fedb5b2ca26 100644 (file)
 /*
 /*     vstream_feof() returns non-zero when a previous operation on the
 /*     specified stream caused an end-of-file condition.
+/*     Further read requests after EOF may complete succesfully,
+/*     even when vstream_clearerr() is not called for that stream.
 /*
 /*     vstream_ferror() returns non-zero when a previous operation on the
 /*     specified stream caused a non-EOF error condition, including timeout.
+/*     After a non-EOF, non-timeout, error on a stream, no I/O request will 
+/*     complete until after vstream_clearerr() is called for that stream.
 /*
 /*     vstream_ftimeout() returns non-zero when a previous operation on the
 /*     specified stream caused a timeout error condition.
+/*     Further I/O requests after timeout may complete succesfully,
+/*     even when vstream_clearerr() is not called for that stream.
 /*
 /*     vstream_clearerr() resets the timeout, error and end-of-file indication
 /*     of the specified stream, and returns no useful result.