@@ -1077,14 +1077,23 @@ public function configure_postfix($options = '') {
10771077 }
10781078
10791079 $ reject_sender_login_mismatch = '' ;
1080- if (isset ($ server_ini_array ['mail ' ]['reject_sender_login_mismatch ' ]) && ($ server_ini_array ['mail ' ]['reject_sender_login_mismatch ' ] == 'y ' )) {
1080+ if (isset ($ server_ini_array ['mail ' ]['reject_sender_login_mismatch ' ]) && ($ server_ini_array ['mail ' ]['reject_sender_login_mismatch ' ] == 'y ' )) {
10811081 $ reject_sender_login_mismatch = ',reject_sender_login_mismatch, ' ;
10821082 }
10831083
10841084 # placeholder includes comment char
10851085 $ stress_adaptive_placeholder = '#{stress_adaptive} ' ;
10861086 $ stress_adaptive = (isset ($ server_ini_array ['mail ' ]['stress_adaptive ' ]) && ($ server_ini_array ['mail ' ]['stress_adaptive ' ] == 'y ' )) ? '' : $ stress_adaptive_placeholder ;
10871087
1088+ $ reject_unknown_client_hostname ='' ;
1089+ if (isset ($ server_ini_array ['mail ' ]['reject_unknown ' ]) && ($ server_ini_array ['mail ' ]['reject_unknown ' ] == 'client ' || $ server_ini_array ['mail ' ]['reject_unknown ' ] == 'client_helo ' )) {
1090+ $ reject_unknown_client_hostname =',reject_unknown_client_hostname ' ;
1091+ }
1092+ $ reject_unknown_helo_hostname ='' ;
1093+ if ((!isset ($ server_ini_array ['mail ' ]['reject_unknown ' ])) || $ server_ini_array ['mail ' ]['reject_unknown ' ] == 'helo ' || $ server_ini_array ['mail ' ]['reject_unknown ' ] == 'client_helo ' ) {
1094+ $ reject_unknown_helo_hostname =',reject_unknown_helo_hostname ' ;
1095+ }
1096+
10881097 unset($ server_ini_array );
10891098
10901099 $ tmp = str_replace ('. ' ,'\. ' ,$ conf ['hostname ' ]);
@@ -1098,6 +1107,8 @@ public function configure_postfix($options = '') {
10981107 '{reject_slm} ' => $ reject_sender_login_mismatch ,
10991108 '{myhostname} ' => $ tmp ,
11001109 $ stress_adaptive_placeholder => $ stress_adaptive ,
1110+ '{reject_unknown_client_hostname} ' => $ reject_unknown_client_hostname ,
1111+ '{reject_unknown_helo_hostname} ' => $ reject_unknown_helo_hostname ,
11011112 );
11021113
11031114 $ postconf_tpl = rfsel ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/debian_postfix.conf.master ' , 'tpl/debian_postfix.conf.master ' );
@@ -1684,14 +1695,12 @@ public function configure_rspamd() {
16841695 $ options = explode (", " , exec ("postconf -h smtpd_sender_restrictions " ));
16851696 $ new_options = array ();
16861697 foreach ($ options as $ key => $ value ) {
1687- if ($ value == '' ) {
1688- continue ;
1689- }
1698+ if (trim ($ value ) == '' ) continue ;
16901699 if (preg_match ('/tag_as_(originating|foreign)\.re/ ' , $ value )) {
16911700 continue ;
16921701 }
16931702 if (!preg_match ('/reject_(authenticated_)?sender_login_mismatch/ ' , $ value )) {
1694- $ new_options [] = $ value ;
1703+ $ new_options [] = trim ( $ value) ;
16951704 }
16961705 }
16971706 if ($ mail_config ['reject_sender_login_mismatch ' ] == 'y ' ) {
0 commit comments