src/smtpd/smtpd.c, src/tls/tls.h, src/tls/tls_client.c,
src/tls/tls_misc.c and src/tls/tls_server.c.
+20070222
+
+ Workaround: delayed "postfix reload" with ancient FreeBSD4
+ kqueue implementations, causing the first external or
+ internal clients after "postfix reload" to experience a
+ quick disconnect. Apparently, these kqueue implementations
+ do not deliver a read notification when the master closes
+ the per-service shared master/child status pipe (even when
+ there is only one child; note that the master keeps a handle
+ to both ends of each status pipe). A child process remains
+ ignorant that the status pipe was closed until the arrival
+ of the next client request, and then terminates. The
+ workaround is to ignore master status write errors before
+ handling a service request. Files: master/*_server.c.
+
+ Cleanup: fix race condition that caused unnecessary "premature
+ end-of-input" warning messages when "postfix reload" was
+ issued on a busy mail server. Files: util/attr_scan*c.
+
Wish list:
Update message content length when adding/removing headers.
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20070221"
+#define MAIL_RELEASE_DATE "20070222"
#define MAIL_VERSION_NUMBER "2.4"
#ifdef SNAPSHOT
msg_fatal("select unlock: %m");
/*
- * Do not bother the application when the client disconnected.
+ * Do not bother the application when the client disconnected. Don't drop
+ * the already accepted client request after "postfix reload"; that would
+ * be rude.
*/
if (peekfd(vstream_fileno(stream)) > 0) {
if (master_notify(var_pid, multi_server_generation, MASTER_STAT_TAKEN) < 0)
- multi_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
+ /* void */ ;
multi_server_service(stream, multi_server_name, multi_server_argv);
if (master_notify(var_pid, multi_server_generation, MASTER_STAT_AVAIL) < 0)
multi_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
* If the accept() succeeds, be sure to disable non-blocking I/O, because
* the application is supposed to be single-threaded. Notice the master
* of our (un)availability to service connection requests. Commit suicide
- * when the master process disconnected from us.
+ * when the master process disconnected from us. Don't drop the already
+ * accepted client request after "postfix reload"; that would be rude.
*/
if (msg_verbose)
msg_info("connection established");
myfree(tmp);
timed_ipc_setup(stream);
if (master_notify(var_pid, single_server_generation, MASTER_STAT_TAKEN) < 0)
- single_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
+ /* void */ ;
if (single_server_in_flow_delay && mail_flow_get(1) < 0)
doze(var_in_flow_delay * 1000000);
single_server_service(stream, single_server_name, single_server_argv);
int len;
/*
- * Commit suicide when the master process disconnected from us.
+ * Commit suicide when the master process disconnected from us. Don't
+ * drop the already accepted client request after "postfix reload"; that
+ * would be rude.
*/
if (master_notify(var_pid, trigger_server_generation, MASTER_STAT_TAKEN) < 0)
- trigger_server_abort(EVENT_NULL_TYPE, EVENT_NULL_CONTEXT);
+ /* void */ ;
if (trigger_server_in_flow_delay && mail_flow_get(1) < 0)
doze(var_in_flow_delay * 1000000);
if ((len = read(fd, buf, sizeof(buf))) >= 0)
if (flags & ~ATTR_FLAG_ALL)
msg_panic("%s: bad flags: 0x%x", myname, flags);
+ /*
+ * EOF check.
+ */
+ if ((ch = VSTREAM_GETC(fp)) == VSTREAM_EOF)
+ return (0);
+ vstream_ungetc(fp, ch);
+
/*
* Initialize.
*/
if (flags & ~ATTR_FLAG_ALL)
msg_panic("%s: bad flags: 0x%x", myname, flags);
+ /*
+ * EOF check.
+ */
+ if ((ch = VSTREAM_GETC(fp)) == VSTREAM_EOF)
+ return (0);
+ vstream_ungetc(fp, ch);
+
/*
* Initialize.
*/
if (flags & ~ATTR_FLAG_ALL)
msg_panic("%s: bad flags: 0x%x", myname, flags);
+ /*
+ * EOF check.
+ */
+ if ((ch = VSTREAM_GETC(fp)) == VSTREAM_EOF)
+ return (0);
+ vstream_ungetc(fp, ch);
+
/*
* Initialize.
*/