Skip to content

Commit f0720ef

Browse files
author
Florian Schaal
committed
corrected do not change the order in smtpd_recipient_restrictions when updating RBLs
1 parent 1838fd1 commit f0720ef

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

server/plugins-available/postfix_server_plugin.inc.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ function update($event_name, $data) {
109109
}
110110

111111
if($mail_config['realtime_blackhole_list'] != $old_ini_data['mail']['realtime_blackhole_list']) {
112+
$rbl_updated = false;
112113
$rbl_hosts = trim(preg_replace('/\s+/', '', $mail_config['realtime_blackhole_list']));
113114
if($rbl_hosts != ''){
114115
$rbl_hosts = explode(",", $rbl_hosts);
@@ -117,9 +118,18 @@ function update($event_name, $data) {
117118
foreach ($options as $key => $value) {
118119
if (!preg_match('/reject_rbl_client/', $value)) {
119120
$new_options[] = $value;
121+
} else {
122+
if(is_array($rbl_hosts) && !empty($rbl_hosts) && !$rbl_updated){
123+
$rbl_updated = true;
124+
foreach ($rbl_hosts as $key => $value) {
125+
$value = trim($value);
126+
if($value != '') $new_options[] = "reject_rbl_client ".$value;
127+
}
128+
}
120129
}
121130
}
122-
if(is_array($rbl_hosts) && !empty($rbl_hosts)){
131+
//* first time add rbl-list
132+
if (!$rbl_updated && is_array($rbl_hosts) && !empty($rbl_hosts)) {
123133
foreach ($rbl_hosts as $key => $value) {
124134
$value = trim($value);
125135
if($value != '') $new_options[] = "reject_rbl_client ".$value;

0 commit comments

Comments
 (0)