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);
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
return unless $DB->get_prop_and_delete('qpsmtpd', 'RequireResolvableFromHost');
|
||||
}
|
38
root/etc/e-smith/db/configuration/migrate/20SBLLIST
Normal file
38
root/etc/e-smith/db/configuration/migrate/20SBLLIST
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
$qpsmtpd = $DB->get('qpsmtpd');
|
||||
return unless $qpsmtpd;
|
||||
my $sbl = $qpsmtpd->prop('SBLList');
|
||||
return unless $sbl;
|
||||
|
||||
my @sbl = ();
|
||||
# Migrate to use , as separator instead of :
|
||||
if ($sbl !~ m/,/){
|
||||
my @zones = split /[:]/, $sbl;
|
||||
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 rhsbl.foo.net:Sorry you are blacklisted
|
||||
# it won't be migrated to rhsbl.foo.net,Sorry you are blacklisted
|
||||
@sbl = ($sbl);
|
||||
}
|
||||
else{
|
||||
@sbl = @zones;
|
||||
}
|
||||
}
|
||||
else{
|
||||
@sbl = split /[,]/, $sbl;
|
||||
}
|
||||
|
||||
my %obsolete = map { $_ => 1} qw(
|
||||
blackhole.securitysage.com
|
||||
bulk.rhs.mailpolice.com
|
||||
fraud.rhs.mailpolice.com
|
||||
porn.rhs.mailpolice.com
|
||||
adult.rhs.mailpolice.com
|
||||
bogusmx.rfc-ignorant.org
|
||||
ex.dnsbl.org
|
||||
);
|
||||
|
||||
@sbl = grep { !$obsolete{$_} } @sbl;
|
||||
$qpsmtpd->set_prop('SBLList', join ',', @sbl);
|
||||
}
|
19
root/etc/e-smith/db/configuration/migrate/80Qpsmtpd
Normal file
19
root/etc/e-smith/db/configuration/migrate/80Qpsmtpd
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
my $smtpd = $DB->get("smtpd");
|
||||
if ($smtpd){
|
||||
my $qpsmtpd = $DB->get("qpsmtpd") ||
|
||||
$DB->new_record("qpsmtpd", { type => "service" });
|
||||
|
||||
$qpsmtpd->merge_props($smtpd->props);
|
||||
$smtpd->delete;
|
||||
}
|
||||
|
||||
my $ssmtpd = $DB->get("ssmtpd");
|
||||
if ($ssmtpd){
|
||||
my $sqpsmtpd = $DB->get("sqpsmtpd") ||
|
||||
$DB->new_record("sqpsmtpd", { type => "service" });
|
||||
|
||||
$sqpsmtpd->merge_props($ssmtpd->props);
|
||||
$ssmtpd->delete;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user