initial commit of file from CVS for smeserver-spamassassin on Mon 10 Jul 08:42:51 BST 2023
This commit is contained in:
46
root/etc/e-smith/db/configuration/migrate/10spamassassin
Normal file
46
root/etc/e-smith/db/configuration/migrate/10spamassassin
Normal file
@@ -0,0 +1,46 @@
|
||||
{
|
||||
my $sa = $DB->get("spamassassin") or return;
|
||||
|
||||
my %old2new = (
|
||||
required_hits => "TagLevel",
|
||||
skip_rbl_checks => "SkipRBLChecks",
|
||||
sort_spam => "SortSpam",
|
||||
use_bayes => "UseBayes",
|
||||
);
|
||||
|
||||
for my $key (keys %old2new)
|
||||
{
|
||||
next unless (exists $spamassassin{$key});
|
||||
|
||||
my $value = $DB->get_prop_and_delete('spamassassin', $key);
|
||||
|
||||
$DB->set_prop('spamassassin', $old2new{$key}, $value);
|
||||
}
|
||||
|
||||
my $sortspam = $DB->get_prop('spamassassin', 'SortSpam');
|
||||
|
||||
if ($sortspam eq "0" or $sortspam eq "1")
|
||||
{
|
||||
$DB->set_prop('spamassassin', 'SortSpam',
|
||||
($sortspam eq "1") ? "enabled" : "disabled");
|
||||
}
|
||||
|
||||
my $value = $DB->get_prop_and_delete('spamassassin', 'rewrite_subject');
|
||||
|
||||
if (defined $value)
|
||||
{
|
||||
$DB->set_prop('spamassassin', 'SubjectTag',
|
||||
($value ? 'enabled' : 'disabled'));
|
||||
}
|
||||
|
||||
# migrate only interesting value from spamd and delete it
|
||||
my $spamd = $DB->get("spamd");
|
||||
if ($spamd){
|
||||
my $SpamLearning = $DB->get_prop('spamassassin', 'SpamLearning') || "empty";
|
||||
if ( exists $spamd{'SpamLearning'} && ! exists $spamassassin{'SpamLearning'} ) {
|
||||
$DB->set_prop('spamassassin', 'SpamLearning', $spamd{'SpamLearning'});
|
||||
}
|
||||
$spamd->delete;
|
||||
}
|
||||
|
||||
}
|
11
root/etc/e-smith/db/configuration/migrate/20sortspam
Normal file
11
root/etc/e-smith/db/configuration/migrate/20sortspam
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
my $dt = $DB->get_prop("qmail", "DeliveryType");
|
||||
my $di = $DB->get_prop("qmail", "DeliveryInstruction");
|
||||
|
||||
return unless ($dt and $di);
|
||||
|
||||
return unless ($dt eq 'program' and $di eq 'sortspam');
|
||||
|
||||
$DB->set_prop("qmail", "DeliveryType", "");
|
||||
$DB->set_prop("qmail", "DeliveryInstruction", "");
|
||||
}
|
Reference in New Issue
Block a user