initial commit of file from CVS for smeserver-qpsmtpd on Thu 26 Oct 11:25:19 BST 2023
This commit is contained in:
35
root/etc/e-smith/db/configuration/migrate/20RBLList
Normal file
35
root/etc/e-smith/db/configuration/migrate/20RBLList
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
$qpsmtpd = $DB->get('qpsmtpd');
|
||||
return unless $qpsmtpd;
|
||||
my $rbl = $qpsmtpd->prop('RBLList');
|
||||
return unless $rbl;
|
||||
|
||||
my @rbl = ();
|
||||
# Migrate to use , as separator instead of :
|
||||
if ($rbl !~ m/,/){
|
||||
my @zones = split /[:]/, $rbl;
|
||||
my $fqdn_re = qr/([a-zA-Z0-9][a-zA-Z0-9\-]{1,61}\.)*[a-zA-Z0-9][a-zA-Z0-9\-]{1,61}\.[a-zA-Z]{2,}/;
|
||||
if (scalar @zones == 2 && $zones[1] !~ m/^$fqdn_re$/){
|
||||
# When we have only two entries, check if the second one looks like a valid hostname
|
||||
# so if you only have something like dnsbl.foo.net:Sorry you are blacklisted
|
||||
# it won't be migrated to dnsbl.foo.net,Sorry you are blacklisted
|
||||
@rbl = ($rbl);
|
||||
}
|
||||
else{
|
||||
@rbl = @zones;
|
||||
}
|
||||
}
|
||||
else{
|
||||
@rbl = split /[,]/, $rbl;
|
||||
}
|
||||
|
||||
my %obsolete = map { $_ => 1} qw(
|
||||
combined.njabl.org
|
||||
list.dsbl.org
|
||||
multihop.dsbl.org
|
||||
dnsbl.ahbl.org
|
||||
);
|
||||
|
||||
@rbl = grep { ! $obsolete{$_} } @rbl;
|
||||
$qpsmtpd->set_prop('RBLList', join ',', @rbl);
|
||||
}
|
Reference in New Issue
Block a user