]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.3.8 v3.3.8
authorWietse Venema <wietse@porcupine.org>
Thu, 12 Mar 2020 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Sun, 15 Mar 2020 23:57:32 +0000 (19:57 -0400)
postfix/HISTORY
postfix/src/global/mail_version.h
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd.h

index 375ca695df0049d54cc55bc71e6d62f89b5e87d2..7c03f3e309c49ced1944042d22b823134135882f 100644 (file)
@@ -23549,3 +23549,9 @@ Apologies for any names omitted.
        had been negotiated. Problem reported by David Bürgin.
        Files: milter/milter.h, milter/milter.c, milter/milter8.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 f273d61d65215b48899ff0d1c7359e1b0b7b980e..6f4b5c08b9afe36a497ee39d7d2a7d9cd1e9360c 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      "20200203"
-#define MAIL_VERSION_NUMBER    "3.3.7"
+#define MAIL_RELEASE_DATE      "20200312"
+#define MAIL_VERSION_NUMBER    "3.3.8"
 
 #ifdef SNAPSHOT
 #define MAIL_VERSION_DATE      "-" MAIL_RELEASE_DATE
index dfacf31052ec6769b6422de6351c238c315e2edb..3b46b871e993777494b31caea1b4fbee55864bf3 100644 (file)
@@ -2570,6 +2570,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));
@@ -2685,11 +2686,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 4facfb0803d9c0ebf233ffb2eb14d9c5908e2fb0..b6437678600db760a5f57a3a6413559a4db588ce 100644 (file)
@@ -195,6 +195,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 \