On Mon, Apr 03, 2017 at 05:08:58PM +0200, Christian Rößner wrote:

> I enabled the smptd_milter_maps again and triggered the problem again.
> After that I counted seconds. And while counting, I sent mails from remote
> each 5 seconds. I aborted after more than 6 minutes. Then I waited about
> 80 seconds and sent again and milters worked again. It seems the milters
> stay unused as long as there exists traffic.
> 
> So the system only starts using the milters again, if there is some silence 
> on the system.
> 
> I think I have tested as good as I could. Hopefully you have enough 
> information now.

Yes, that's enough information.  Patch below:

diff --git a/src/smtpd/smtpd.c b/src/smtpd/smtpd.c
index 986264b2..1eaf1300 100644
--- a/src/smtpd/smtpd.c
+++ b/src/smtpd/smtpd.c
@@ -1461,6 +1461,7 @@ static NAMADR_LIST *hogger_list;
   * Other application-specific globals.
   */
 int     smtpd_input_transp_mask;
+static int smtpd_input_transp_mask_saved;
 
  /*
   * Forward declarations.
@@ -5386,6 +5387,8 @@ static void setup_milters(SMTPD_STATE *state)
      */
     if (state->milters == 0)
        smtpd_input_transp_mask |= INPUT_TRANSP_MILTER;
+    else
+       smtpd_input_transp_mask = smtpd_input_transp_mask_saved;
 }
 
 /* teardown_milters - release resources */
@@ -5714,7 +5717,7 @@ static void post_jail_init(char *unused_name, char 
**unused_argv)
      * Initialize the receive transparency options: do we want unknown
      * recipient checks, address mapping, header_body_checks?.
      */
-    smtpd_input_transp_mask =
+    smtpd_input_transp_mask_saved = smtpd_input_transp_mask =
     input_transp_mask(VAR_INPUT_TRANSP, var_input_transp);
 
     /*

-- 
        Viktor.

Reply via email to