@@ -81,11 +81,40 @@ public function configure_postfix($options = '')
8181 }
8282
8383 //* These postconf commands will be executed on installation and update
84+ $ server_ini_rec = $ this ->db ->queryOneRecord ("SELECT config FROM ` " . $ this ->db ->quote ($ conf ["mysql " ]["database " ]) . "`.`server` WHERE server_id = " .$ conf ['server_id ' ]);
85+ $ server_ini_array = ini_to_array (stripslashes ($ server_ini_rec ['config ' ]));
86+ unset($ server_ini_rec );
87+
88+ //* If there are RBL's defined, format the list and add them to smtp_recipient_restrictions to prevent removeal after an update
89+ $ rbl_list = '' ;
90+ if (@isset ($ server_ini_array ['mail ' ]['realtime_blackhole_list ' ]) && $ server_ini_array ['mail ' ]['realtime_blackhole_list ' ] != '' ) {
91+ $ rbl_hosts = explode (", " , str_replace (" " , "" , $ server_ini_array ['mail ' ]['realtime_blackhole_list ' ]));
92+ foreach ($ rbl_hosts as $ key => $ value ) {
93+ $ rbl_list .= ", reject_rbl_client " . $ value ;
94+ }
95+ }
96+ unset($ rbl_hosts );
97+
98+ //* If Postgrey is installed, configure it
99+ $ greylisting = '' ;
100+ if ($ conf ['postgrey ' ]['installed ' ] == true ) {
101+ $ greylisting = ', check_recipient_access mysql:/etc/postfix/mysql-virtual_policy_greylist.cf ' ;
102+ }
103+
104+ $ reject_sender_login_mismatch = '' ;
105+ if (isset ($ server_ini_array ['mail ' ]['reject_sender_login_mismatch ' ]) && ($ server_ini_array ['mail ' ]['reject_sender_login_mismatch ' ] == 'y ' )) {
106+ $ reject_sender_login_mismatch = ', reject_authenticated_sender_login_mismatch ' ;
107+ }
108+ unset($ server_ini_array );
109+
84110 $ postconf_placeholders = array ('{config_dir} ' => $ config_dir ,
85111 '{vmail_mailbox_base} ' => $ cf ['vmail_mailbox_base ' ],
86112 '{vmail_userid} ' => $ cf ['vmail_userid ' ],
87113 '{vmail_groupid} ' => $ cf ['vmail_groupid ' ],
88- '{rbl_list} ' => $ rbl_list );
114+ '{rbl_list} ' => $ rbl_list ,
115+ '{greylisting} ' => $ greylisting ,
116+ '{reject_slm} ' => $ reject_sender_login_mismatch ,
117+ );
89118
90119 $ postconf_tpl = rfsel ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/gentoo_postfix.conf.master ' , 'tpl/gentoo_postfix.conf.master ' );
91120 $ postconf_tpl = strtr ($ postconf_tpl , $ postconf_placeholders );
0 commit comments