@@ -146,7 +146,8 @@ function update($event_name, $data) {
146146 $ options = preg_split ("/,\s*/ " , exec ("postconf -h smtpd_sender_restrictions " ));
147147 $ new_options = array ();
148148 foreach ($ options as $ key => $ value ) {
149- if (($ value = trim ($ value )) == '' ) continue ;
149+ $ value = trim ($ value );
150+ if ($ value == '' ) continue ;
150151 if (preg_match ('/reject_(authenticated_)?sender_login_mismatch/ ' , $ value )) {
151152 continue ;
152153 }
@@ -169,10 +170,11 @@ function update($event_name, $data) {
169170
170171 if ($ mail_config ['reject_unknown ' ]) {
171172 if (($ mail_config ['reject_unknown ' ] === 'client ' ) || ($ mail_config ['reject_unknown ' ] === 'client_helo ' )) {
172- $ options = explode ( " , " , exec ("postconf -h smtpd_client_restrictions " ));
173+ $ options = preg_split ( " /,\s*/ " , exec ("postconf -h smtpd_client_restrictions " ));
173174 $ new_options = array ();
174175 foreach ($ options as $ key => $ value ) {
175- if (($ value = trim ($ value )) == '' ) continue ;
176+ $ value = trim ($ value );
177+ if ($ value == '' ) continue ;
176178 if (preg_match ('/reject_unknown(_client)?_hostname/ ' , $ value )) {
177179 continue ;
178180 }
@@ -192,10 +194,11 @@ function update($event_name, $data) {
192194
193195 $ app ->system ->exec_safe ("postconf -e ? " , 'smtpd_client_restrictions = ' .implode (", " , $ new_options ));
194196 } else {
195- $ options = explode ( " , " , exec ("postconf -h smtpd_client_restrictions " ));
197+ $ options = preg_split ( " /,\s*/ " , exec ("postconf -h smtpd_client_restrictions " ));
196198 $ new_options = array ();
197199 foreach ($ options as $ key => $ value ) {
198- if (($ value = trim ($ value )) == '' ) continue ;
200+ $ value = trim ($ value );
201+ if ($ value == '' ) continue ;
199202 if (preg_match ('/reject_unknown(_client)?_hostname/ ' , $ value )) {
200203 continue ;
201204 }
@@ -205,10 +208,11 @@ function update($event_name, $data) {
205208 }
206209
207210 if (($ mail_config ['reject_unknown ' ] === 'helo ' ) || ($ mail_config ['reject_unknown ' ] === 'client_helo ' )) {
208- $ options = explode ( " , " , exec ("postconf -h smtpd_helo_restrictions " ));
211+ $ options = preg_split ( " /,\s*/ " , exec ("postconf -h smtpd_helo_restrictions " ));
209212 $ new_options = array ();
210213 foreach ($ options as $ key => $ value ) {
211- if (($ value = trim ($ value )) == '' ) continue ;
214+ $ value = trim ($ value );
215+ if ($ value == '' ) continue ;
212216 if (preg_match ('/reject_unknown(_helo)?_hostname/ ' , $ value )) {
213217 continue ;
214218 }
@@ -228,10 +232,11 @@ function update($event_name, $data) {
228232
229233 $ app ->system ->exec_safe ("postconf -e ? " , 'smtpd_helo_restrictions = ' .implode (", " , $ new_options ));
230234 } else {
231- $ options = explode ( " , " , exec ("postconf -h smtpd_helo_restrictions " ));
235+ $ options = preg_split ( " /,\s*/ " , exec ("postconf -h smtpd_helo_restrictions " ));
232236 $ new_options = array ();
233237 foreach ($ options as $ key => $ value ) {
234- if (($ value = trim ($ value )) == '' ) continue ;
238+ $ value = trim ($ value );
239+ if ($ value == '' ) continue ;
235240 if (preg_match ('/reject_unknown(_helo)?_hostname/ ' , $ value )) {
236241 continue ;
237242 }
@@ -324,7 +329,7 @@ function update($event_name, $data) {
324329 if (defined ($ configure_lmtp ) && $ configure_lmtp ) {
325330 for ($ i = 0 ; isset ($ new_options [$ i ]); $ i ++) {
326331 if ($ new_options [$ i ] == 'reject_unlisted_recipient ' ) {
327- array_splice ($ new_options , $ i +1 , 0 , array ("check_recipient_access proxy:mysql: $ {postfix_config_dir }/mysql-verify_recipients.cf " ));
332+ array_splice ($ new_options , $ i +1 , 0 , array ("check_recipient_access proxy:mysql: $ {quoted_postfix_config_dir }/mysql-verify_recipients.cf " ));
328333 break ;
329334 }
330335 }
0 commit comments