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
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>
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>
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>
* 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
* 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);
}
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);
} \
} 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); \
/*
* 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))) {
/*
* 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);
/*
* 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);
#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)
/*
/* 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.