Ralf Hildebrandt:
> Immediately after I upgraded to postfix-2.8-20110102-nonprod, I got
> these errors when connecting to the smtp port:
> 
> Jan  2 11:10:23 mail postfix/postfix-script[638]: stopping the Postfix mail 
> system
> Jan  2 11:10:23 mail postfix/master[32086]: terminating on signal 15
> Jan  2 11:10:25 mail postfix/postfix-script[737]: starting the Postfix mail 
> system
> Jan  2 11:10:25 mail postfix/master[738]: daemon started -- version 
> 2.8-20110102-nonprod, configuration /etc/postfix
> Jan  2 11:10:25 mail postfix/postscreen[741]: fatal: open 
> /etc/postfix/smtpd_discard_ehlo_keyword.cidr: No such file or directory

The patch below moves the "open discard_ehlo_keyword_address_maps"
code to the "before chroot" initialization.

        Wietse

diff -cr /var/tmp/postfix-2.8-20110102-nonprod/src/postscreen/postscreen.c 
./src/postscreen/postscreen.c
*** /var/tmp/postfix-2.8-20110102-nonprod/src/postscreen/postscreen.c   Sat Jan 
 1 21:07:39 2011
--- ./src/postscreen/postscreen.c       Sun Jan  2 09:21:24 2011
***************
*** 771,776 ****
--- 771,781 ----
       */
      vstring_free(redirect);
      RESTORE_SAVED_EUGID();
+ 
+     /*
+      * Initialize the dummy SMTP engine.
+      */
+     ps_smtpd_pre_jail_init();
  }
  
  /* pre_accept - see if tables have changed */
diff -cr /var/tmp/postfix-2.8-20110102-nonprod/src/postscreen/postscreen.h 
./src/postscreen/postscreen.h
*** /var/tmp/postfix-2.8-20110102-nonprod/src/postscreen/postscreen.h   Sat Jan 
 1 14:15:11 2011
--- ./src/postscreen/postscreen.h       Sun Jan  2 09:20:12 2011
***************
*** 425,430 ****
--- 425,431 ----
    */
  extern void ps_smtpd_tests(PS_STATE *);
  extern void ps_smtpd_init(void);
+ extern void ps_smtpd_pre_jail_init(void);
  
   /*
    * postscreen_misc.c
diff -cr 
/var/tmp/postfix-2.8-20110102-nonprod/src/postscreen/postscreen_smtpd.c 
./src/postscreen/postscreen_smtpd.c
*** /var/tmp/postfix-2.8-20110102-nonprod/src/postscreen/postscreen_smtpd.c     
Sat Jan  1 18:17:05 2011
--- ./src/postscreen/postscreen_smtpd.c Sun Jan  2 09:30:52 2011
***************
*** 6,16 ****
--- 6,21 ----
  /* SYNOPSIS
  /*    #include <postscreen.h>
  /*
+ /*    void    ps_smtpd_pre_jail_init(void)
+ /*
  /*    void    ps_smtpd_init(void)
  /*
  /*    void    ps_smtpd_tests(state)
  /*    PS_STATE *state;
  /* DESCRIPTION
+ /*    ps_smtpd_pre_jail_init() performs one-time per-process
+ /*    initialization during the "before chroot" execution phase.
+ /*
  /*    ps_smtpd_init() performs one-time per-process initialization.
  /*
  /*    ps_smtpd_tests() starts up an SMTP server engine for deep
***************
*** 1078,1095 ****
  #endif
  
      /*
-      * Determine what server ESMTP features to suppress, typically to avoid
-      * inter-operability problems. We do the default filter here, and
-      * determine client-dependent filtering on the fly.
-      * 
-      * XXX Bugger. This means we have to restart when the table changes!
-      */
-     ps_ehlo_discard_maps = maps_create(VAR_PS_EHLO_DIS_MAPS,
-                                      var_ps_ehlo_dis_maps,
-                                      DICT_FLAG_LOCK);
-     ps_ehlo_discard_mask = ehlo_mask(var_ps_ehlo_dis_words);
- 
-     /*
       * Initialize the EHLO reply. Once for plaintext sessions, and once for
       * TLS sessions.
       */
--- 1083,1088 ----
***************
*** 1114,1116 ****
--- 1107,1127 ----
                    var_myhostname);
      ps_smtpd_421_reply = mystrdup(STR(ps_temp));
  }
+ 
+ /* ps_smtpd_pre_jail_init - per-process deep protocol test initialization */
+ 
+ void    ps_smtpd_pre_jail_init(void)
+ {
+ 
+     /*
+      * Determine what server ESMTP features to suppress, typically to avoid
+      * inter-operability problems. We do the default filter here, and
+      * determine client-dependent filtering on the fly.
+      * 
+      * XXX Bugger. This means we have to restart when the table changes!
+      */
+     ps_ehlo_discard_maps = maps_create(VAR_PS_EHLO_DIS_MAPS,
+                                      var_ps_ehlo_dis_maps,
+                                      DICT_FLAG_LOCK);
+     ps_ehlo_discard_mask = ehlo_mask(var_ps_ehlo_dis_words);
+ }

Reply via email to