On Mon, Apr 03, 2017 at 02:03:41PM -0400, Viktor Dukhovni wrote:
> > Any idea is welcome.
>
> For Postfix 3.2.0 see: https://github.com/vdukhovni/postfix/pull/8
> For 3.3-20170218, see: https://github.com/vdukhovni/postfix/pull/7
>
> The underlying patch is identical. There could be other ways
> to address the issue, perhaps by avoiding changing the static
> smtpd_input_transp_mask variable, but such a change would be
> more invasive.
On the other hand, perhaps not so bad after all:
diff --git a/src/smtpd/smtpd.c b/src/smtpd/smtpd.c
index 986264b2..742863c4 100644
--- a/src/smtpd/smtpd.c
+++ b/src/smtpd/smtpd.c
@@ -2007,8 +2007,15 @@ static int mail_open_stream(SMTPD_STATE *state)
else if (SMTPD_STAND_ALONE(state) == 0) {
int cleanup_flags;
+ /*
+ * Safety: disable non_smtpd_milters when not sending our own mail
+ * filter list. Otherwise the next stage could handle this message as a
+ * local submission.
+ */
cleanup_flags = input_transp_cleanup(CLEANUP_FLAG_MASK_EXTERNAL,
- smtpd_input_transp_mask)
+ smtpd_input_transp_mask |
+ (state->milters ? 0 :
+ INPUT_TRANSP_MILTER))
| CLEANUP_FLAG_SMTP_REPLY;
if (state->flags & SMTPD_FLAG_SMTPUTF8)
cleanup_flags |= CLEANUP_FLAG_SMTPUTF8;
@@ -5378,14 +5385,6 @@ static void setup_milters(SMTPD_STATE *state)
var_milt_unk_macros,
var_milt_macro_deflts);
}
-
- /*
- * Safety: disable non_smtpd_milters when not sending our own mail filter
- * list. Otherwise the next stage could handle this message as a local
- * submission.
- */
- if (state->milters == 0)
- smtpd_input_transp_mask |= INPUT_TRANSP_MILTER;
}
/* teardown_milters - release resources */
--
Viktor.