]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.3.6 v3.3.6
authorWietse Venema <wietse@porcupine.org>
Sat, 21 Sep 2019 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sun, 22 Sep 2019 20:40:09 +0000 (16:40 -0400)
postfix/HISTORY
postfix/src/global/mail_params.h
postfix/src/global/mail_version.h
postfix/src/postscreen/postscreen_smtpd.c
postfix/src/tlsproxy/tlsproxy.c
postfix/src/util/vstream_tweak.c
postfix/src/xsasl/xsasl_dovecot_server.c

index bf6d9861d39da1b50e4f79cce7001e7d39e733d1..c16fc3eb58c756b76be61089802f65da1601e7fe 100644 (file)
@@ -23476,3 +23476,48 @@ Apologies for any names omitted.
        handshake failure, causing stale numbers to be reported.
        The command counts are now reset in the function that reports
        the counts. File: smtpd/smtpd.c.
+
+20190723
+
+       Bugfix: the documentation said tls_fast_shutdown_enable,
+       but the code said tls_fast_shutdown. Viktor Dukhovni. Changed
+       the code because no-one is expected to override the default.
+       File: global/mail_params.h.
+
+20190820
+
+       Workaround for poor TCP loopback performance on LINUX, where
+       getsockopt(..., TCP_MAXSEG, ..) reports a TCP maximal segment
+       size that is 1/2 to 1/3 of the MTU. For example, with kernel
+       5.1.16-300.fc30.x86_64 the TCP client and server announce
+       an mss of 65495 in the TCP handshake, but getsockopt()
+       returns 32741 (less than half). As a matter of principle,
+       Postfix won't turn on client-side TCP_NODELAY because that
+       hides application performance bugs, and because that still
+       suffers from server-side delayed ACKs. Instead, Postfix
+       avoids sending "small" writes back-to-back, by choosing a
+       VSTREAM buffer size that is a multiple of the reported MSS.
+       This workaround bumps the multiplier from 2x to 4x. File:
+       util/vstream_tweak.c.
+
+20190825
+
+       Bugfix (introduced: 20051222): the Dovecot client could
+       segfault (null pointer read) or cause an SMTP server assertion
+       to fail when talking to a fake Dovecot server. The client
+       now logs a proper error instead. Problem reported by Tim
+       Düsterhus. File: xsasl/xsasl_dovecot_server.c.
+
+20190914
+
+       Bitrot: don't invoke SSL_shutdown() when the SSL engine
+       thinks it is processing a TLS handshake. The commit at
+       https://github.com/openssl/openssl/commit/64193c8218540499984cd63cda41f3cd491f3f59
+       changed the error status, incompatibly, from SSL_ERROR_NONE
+       into SSL_ERROR_SSL. File: tlsproxy/tlsproxxy.c.
+
+20190921 (backport from Postfix >= 3.4)
+
+       Bugfix (introduced: Postfix-2.9.0): null pointer read, while
+       logging a warning after a postscreen_command_filter read
+       error. File: postscreen/postscreen_smtpd.c.
index 3bd06de2ff493941ede6d1f2b6c7ff9fc9522e4b..e83ef2a5459c1da88f237b7e7f8d1efb72a52144 100644 (file)
@@ -3339,7 +3339,7 @@ extern bool var_tls_dane_taa_dgst;
  /*
   * The default is backwards-incompatible.
   */
-#define VAR_TLS_FAST_SHUTDOWN  "tls_fast_shutdown"
+#define VAR_TLS_FAST_SHUTDOWN  "tls_fast_shutdown_enable"
 #define DEF_TLS_FAST_SHUTDOWN  1
 extern bool var_tls_fast_shutdown;
 
index dd324ad0101c1613a343fd5a0bc17247e0d055e9..b5ee8ae9f70739e5bfc8b54a8e48b05ce8070864 100644 (file)
@@ -20,8 +20,8 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20190629"
-#define MAIL_VERSION_NUMBER    "3.3.5"
+#define MAIL_RELEASE_DATE      "20190921"
+#define MAIL_VERSION_NUMBER    "3.3.6"
 
 #ifdef SNAPSHOT
 #define MAIL_VERSION_DATE      "-" MAIL_RELEASE_DATE
index 814eedc1c9a07fb1b179de3ddcd53128c5f4b214..d043aee8ab68eaf1ca555e74107e92e69ea59a5e 100644 (file)
@@ -901,7 +901,8 @@ static void psc_smtpd_read_event(int event, void *context)
                vstring_strcpy(state->cmd_buffer, cp);
            } else if (psc_cmd_filter->error != 0) {
                msg_fatal("%s:%s lookup error for \"%.100s\"",
-                         psc_cmd_filter->type, psc_cmd_filter->name, cp);
+                         psc_cmd_filter->type, psc_cmd_filter->name,
+                         STR(state->cmd_buffer));
            }
        }
 
index 0604a1d674d7835437b0afac4951ee66c42946a1..dc1550640eb56b9724dd981b4f2380ec0147d3bc 100644 (file)
@@ -510,9 +510,8 @@ static void tlsp_strategy(TLSP_STATE *state)
     if (NBBIO_ERROR_FLAGS(plaintext_buf)) {
        if (NBBIO_ACTIVE_FLAGS(plaintext_buf))
            nbbio_disable_readwrite(state->plaintext_buf);
-       ssl_stat = SSL_shutdown(tls_context->con);
-       /* XXX Wait for return value 1 if sessions are to be reused? */
-       if (ssl_stat < 0) {
+       if (!SSL_in_init(tls_context->con)
+           && (ssl_stat = SSL_shutdown(tls_context->con)) < 0) {
            handshake_err = SSL_get_error(tls_context->con, ssl_stat);
            tlsp_eval_tls_error(state, handshake_err);
            /* At this point, state could be a dangling pointer. */
index 668654d05f1e1701d5a6fd6fe438be5f63256cbc..a2e220c45058eeb14e55545881f9a62e0be0a610 100644 (file)
@@ -124,12 +124,20 @@ int     vstream_tweak_tcp(VSTREAM *fp)
      * stream buffer size to less than VSTREAM_BUFSIZE, when the request is
      * made before the first stream read or write operation. We don't want to
      * reduce the buffer size.
+     * 
+     * As of 20190820 we increase the mss size multipler from 2x to 4x, because
+     * some LINUX loopback TCP stacks report an MSS of 21845 which is 3x
+     * smaller than the MTU of 65536. Even with a VSTREAM buffer 2x the
+     * reported MSS size, performance would suck due to Nagle or delayed ACK
+     * delays.
      */
 #define EFF_BUFFER_SIZE(fp) (vstream_req_bufsize(fp) ? \
                vstream_req_bufsize(fp) : VSTREAM_BUFSIZE)
 
 #ifdef CA_VSTREAM_CTL_BUFSIZE
-    if (mss > EFF_BUFFER_SIZE(fp) / 2) {
+    if (mss > EFF_BUFFER_SIZE(fp) / 4) {
+       if (mss < INT_MAX / 2)
+           mss *= 2;
        if (mss < INT_MAX / 2)
            mss *= 2;
        vstream_control(fp,
index 226cf11a6bed2a4864d2610faff40e57736f26f7..601f7874bc914d2d05438bf5a5c13f2e20360c37 100644 (file)
@@ -584,10 +584,20 @@ static int xsasl_dovecot_handle_reply(XSASL_DOVECOT_SERVER *server,
            if (xsasl_dovecot_parse_reply(server, &line) == 0) {
                /* authentication successful */
                xsasl_dovecot_parse_reply_args(server, line, reply, 1);
+               if (server->username == 0) {
+                   msg_warn("missing Dovecot server %s username field", cmd);
+                   vstring_strcpy(reply, "Authentication backend error");
+                   return XSASL_AUTH_FAIL;
+               }
                return XSASL_AUTH_DONE;
            }
        } else if (strcmp(cmd, "CONT") == 0) {
            if (xsasl_dovecot_parse_reply(server, &line) == 0) {
+               if (line == 0) {
+                   msg_warn("missing Dovecot server %s reply field", cmd);
+                   vstring_strcpy(reply, "Authentication backend error");
+                   return XSASL_AUTH_FAIL;
+               }
                vstring_strcpy(reply, line);
                return XSASL_AUTH_MORE;
            }