@@ -625,6 +625,21 @@ public function configure_postfix($options = '') {
625625 $ command = 'useradd -g ' .$ cf ['vmail_groupname ' ].' -u ' .$ cf ['vmail_userid ' ].' ' .$ cf ['vmail_username ' ].' -d ' .$ cf ['vmail_mailbox_base ' ].' -m ' ;
626626 if (!is_user ($ cf ['vmail_username ' ])) caselog ("$ command &> /dev/null " , __FILE__ , __LINE__ , "EXECUTED: $ command " , "Failed to execute the command $ command " );
627627
628+ $ server_ini_rec = $ this ->db ->queryOneRecord ("SELECT config FROM server WHERE server_id = " .$ conf ['server_id ' ]);
629+ $ server_ini_array = ini_to_array (stripslashes ($ server_ini_rec ['config ' ]));
630+ unset($ server_ini_rec );
631+
632+ //* If there are RBL's defined, format the list and add them to smtp_recipient_restrictions to prevent removeal after an update
633+ $ rbl_list = '' ;
634+ if ($ server_ini_array ['mail ' ]['realtime_blackhole_list ' ] != '' ) {
635+ $ rbl_hosts = explode (", " ,str_replace (" " , "" , $ server_ini_array ['mail ' ]['realtime_blackhole_list ' ]));
636+ foreach ($ rbl_hosts as $ key => $ value ) {
637+ $ rbl_list .= ", reject_rbl_client " . $ value ;
638+ }
639+ }
640+ unset($ rbl_hosts );
641+ unset($ server_ini_array );
642+
628643 $ postconf_commands = array (
629644 'myhostname = ' .$ conf ['hostname ' ],
630645 'mydestination = ' .$ conf ['hostname ' ].', localhost, localhost.localdomain ' ,
@@ -641,7 +656,7 @@ public function configure_postfix($options = '') {
641656 'smtpd_sasl_auth_enable = yes ' ,
642657 'broken_sasl_auth_clients = yes ' ,
643658 'smtpd_sasl_authenticated_header = yes ' ,
644- 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql: ' .$ config_dir .'/mysql-virtual_recipient.cf, reject_unauth_destination ' ,
659+ 'smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql: ' .$ config_dir .'/mysql-virtual_recipient.cf, reject_unauth_destination ' . $ rbl_list ,
645660 'smtpd_use_tls = yes ' ,
646661 'smtpd_tls_security_level = may ' ,
647662 'smtpd_tls_cert_file = ' .$ config_dir .'/smtpd.cert ' ,
0 commit comments