Prereq: "3.2.12" diff -ur --new-file /var/tmp/postfix-3.2.12/src/global/mail_version.h ./src/global/mail_version.h --- /var/tmp/postfix-3.2.12/src/global/mail_version.h 2020-02-02 15:10:17.000000000 -0500 +++ ./src/global/mail_version.h 2020-03-12 11:06:30.000000000 -0400 @@ -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.2.12" +#define MAIL_RELEASE_DATE "20200312" +#define MAIL_VERSION_NUMBER "3.2.13" #ifdef SNAPSHOT #define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE diff -ur --new-file /var/tmp/postfix-3.2.12/HISTORY ./HISTORY --- /var/tmp/postfix-3.2.12/HISTORY 2020-02-02 12:42:27.000000000 -0500 +++ ./HISTORY 2020-03-12 11:03:19.000000000 -0400 @@ -23259,3 +23259,9 @@ 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. diff -ur --new-file /var/tmp/postfix-3.2.12/src/smtpd/smtpd.c ./src/smtpd/smtpd.c --- /var/tmp/postfix-3.2.12/src/smtpd/smtpd.c 2019-06-29 09:34:06.000000000 -0400 +++ ./src/smtpd/smtpd.c 2020-03-12 11:02:29.000000000 -0400 @@ -2566,6 +2566,7 @@ } 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)); @@ -2681,11 +2682,14 @@ 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; diff -ur --new-file /var/tmp/postfix-3.2.12/src/smtpd/smtpd.h ./src/smtpd/smtpd.h --- /var/tmp/postfix-3.2.12/src/smtpd/smtpd.h 2016-10-22 18:15:02.000000000 -0400 +++ ./src/smtpd/smtpd.h 2020-03-12 11:02:29.000000000 -0400 @@ -195,6 +195,7 @@ #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 \