]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.5.0-RC2
authorWietse Venema <wietse@porcupine.org>
Thu, 12 Mar 2020 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Mon, 16 Mar 2020 00:00:55 +0000 (20:00 -0400)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd.h

index e7579aff1751109d2de05721778fca674a74fa70..e3e1ab6405cf065e4ac6d2531e91243176b5ec34 100644 (file)
@@ -24653,3 +24653,10 @@ Apologies for any names omitted.
 
        Cleanup: harmless memory leak in postconf. File:
        postconf/postconf_master.c.
+
+20200312
+
+       Bugfix (introduced: Postfix 2.3): panic with Postfix
+       multi-Milter configuration during MAIL FROM. Milter client
+       state was not properly reset after one of the Milters failed.
+       Reported by WeiYu Wu.
index 0cfe0a5caa51f4fd3a270e1d14b3a329069e781b..a13af07670d5f60a6535f37b73e78c98de6f7d15 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      "20200308"
-#define MAIL_VERSION_NUMBER    "3.5-RC1"
+#define MAIL_RELEASE_DATE      "20200312"
+#define MAIL_VERSION_NUMBER    "3.5.0-RC2"
 
 #ifdef SNAPSHOT
 #define MAIL_VERSION_DATE      "-" MAIL_RELEASE_DATE
index f9b766049fda465e1f86f465f08a6341da847a0c..2059bd5e2f00d020140ffcc3606964592317f5b8 100644 (file)
@@ -2615,6 +2615,7 @@ static int mail_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *argv)
     }
     if (state->milters != 0
        && (state->saved_flags & MILTER_SKIP_FLAGS) == 0) {
+       state->flags |= SMTPD_FLAG_NEED_MILTER_ABORT;
        PUSH_STRING(saved_sender, state->sender, STR(state->addr_buf));
        err = milter_mail_event(state->milters,
                                milter_argv(state, argc - 2, argv + 2));
@@ -2730,11 +2731,14 @@ static void mail_reset(SMTPD_STATE *state)
        state->queue_id = 0;
     }
     if (state->sender) {
-       if (state->milters != 0)
-           milter_abort(state->milters);
        myfree(state->sender);
        state->sender = 0;
     }
+    /* WeiYu Wu: need to undo milter_mail_event() state change. */
+    if (state->flags & SMTPD_FLAG_NEED_MILTER_ABORT) {
+       milter_abort(state->milters);
+       state->flags &= ~SMTPD_FLAG_NEED_MILTER_ABORT;
+    }
     if (state->verp_delims) {
        myfree(state->verp_delims);
        state->verp_delims = 0;
index ae194035cc735eb4130d9bae85cf9c7d2670d681..490cda2facf1a6c082a4bc47a2cc6a337556b472 100644 (file)
@@ -206,6 +206,7 @@ typedef struct {
 #define SMTPD_FLAG_ILL_PIPELINING  (1<<1)      /* inappropriate pipelining */
 #define SMTPD_FLAG_AUTH_USED      (1<<2)       /* don't reuse SASL state */
 #define SMTPD_FLAG_SMTPUTF8       (1<<3)       /* RFC 6531/2 transaction */
+#define SMTPD_FLAG_NEED_MILTER_ABORT (1<<4)    /* undo milter_mail_event() */
 
  /* Security: don't reset SMTPD_FLAG_AUTH_USED. */
 #define SMTPD_MASK_MAIL_KEEP \