initial commit of file from CVS for smeserver-spamassassin on Mon 10 Jul 08:42:51 BST 2023
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{
|
||||
return "dns_available " . ($spamassassin{DNSAvailable} || 'yes');
|
||||
}
|
@@ -0,0 +1 @@
|
||||
{ "internal_networks $LocalIP" }
|
@@ -0,0 +1 @@
|
||||
{ "lock_method flock" }
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
$langs = ($spamassassin{OkLanguages} || 'all');
|
||||
return "" if $langs eq 'all';
|
||||
$OUT = "loadplugin Mail::SpamAssassin::Plugin::TextCat\n";
|
||||
$OUT .= "ok_languages $langs";
|
||||
return $OUT;
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
return "ok_locales " . ($spamassassin{OkLocales} || 'all');
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
bayes_path /var/spool/spamd/.spamassassin/bayes
|
||||
bayes_file_mode 750
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
return "report_safe " . ($spamassassin{ReportSafe} || 0);
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
{
|
||||
my $sens = $spamassassin{Sensitivity} || 'medium';
|
||||
|
||||
my %sens2hits = (
|
||||
'veryhigh' => 2,
|
||||
'high' => 3,
|
||||
'medium' => 5,
|
||||
'low' => 7,
|
||||
'verylow' => 9,
|
||||
);
|
||||
|
||||
my $hits = ($sens eq 'custom') ? $spamassassin{TagLevel}
|
||||
: $sens2hits{$sens};
|
||||
|
||||
return "required_score $hits";
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
{
|
||||
return "" unless ($spamassassin{SubjectTag} eq 'enabled');
|
||||
|
||||
return "" unless ($spamassassin{Subject});
|
||||
|
||||
return "rewrite_header Subject $spamassassin{Subject}";
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
return "skip_rbl_checks " . ($spamassassin{SkipRBLChecks} || 0);
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
{
|
||||
$OUT = "clear_trusted_networks\n";
|
||||
$OUT .= "trusted_networks $LocalIP " . ($spamassassin{TrustedNetworks} || '');
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
if (($spamassassin{UseAutoWhitelist} || "0") eq "1")
|
||||
{
|
||||
$OUT = "use_auto_whitelist 1\n";
|
||||
$OUT .= "auto_whitelist_path /var/spool/spamd/.spamassassin/auto-whitelist\n";
|
||||
$OUT .= "auto_whitelist_file_mode 750\n";
|
||||
}
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
{
|
||||
return "use_bayes " . ($spamassassin{UseBayes} || 0);
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
{
|
||||
return "# bayes disabled" unless $spamassassin{UseBayes};
|
||||
|
||||
my $AutoLearn = $spamassassin{UseBayesAutoLearn} || 0;
|
||||
# default SA value of 12 is too high
|
||||
my $BayesAutoLearnThresholdSpam = $spamassassin{'BayesAutoLearnThresholdSpam'}||6;
|
||||
# 0.10 is spamassassin default but it is too high, set to -1.15.
|
||||
my $BayesAutoLearnThresholdNonspam = $spamassassin{'BayesAutoLearnThresholdNonSpam'}|| -1.15;
|
||||
|
||||
# should get at least 6: 3 from body and 3 from header.
|
||||
# http://spamassassin.apache.org/full/3.1.x/doc/Mail_SpamAssassin_Plugin_AutoLearnThreshold.html
|
||||
$BayesAutoLearnThresholdSpam = 6 unless $BayesAutoLearnThresholdSpam >= 6;
|
||||
|
||||
$OUT = "bayes_auto_learn $AutoLearn\n";
|
||||
return unless $AutoLearn == 1;
|
||||
$OUT .= "bayes_auto_learn_threshold_nonspam $BayesAutoLearnThresholdNonspam\n";
|
||||
$OUT .= "bayes_auto_learn_threshold_spam $BayesAutoLearnThresholdSpam\n";
|
||||
}
|
@@ -0,0 +1,2 @@
|
||||
add_header all Status _YESNO_, score=_SCORE_ required=_REQD_ autolearn=_AUTOLEARN_
|
||||
add_header all Details _REPORT_
|
@@ -0,0 +1,8 @@
|
||||
{
|
||||
my $pyzor_timeout = ($spamassassin{PyzorTimeout} || 0);
|
||||
if ($pyzor_timeout ne '0')
|
||||
{
|
||||
return "pyzor_timeout " . ($pyzor_timeout);
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,20 @@
|
||||
{
|
||||
use esmith::ConfigDB;
|
||||
|
||||
my $dbh = esmith::ConfigDB->open_ro('spamassassin')
|
||||
|| die "Unable to open spamassassin configuration dbase.";
|
||||
my %wbl = $dbh->get('wbl.global')->props;
|
||||
|
||||
$OUT = '';
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%wbl)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "White") {
|
||||
$OUT .= "whitelist_from " . $parameter . "\n";
|
||||
} elsif ($value eq "Black") {
|
||||
$OUT .= "blacklist_from " . $parameter . "\n";
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,20 @@
|
||||
{
|
||||
use esmith::ConfigDB;
|
||||
|
||||
my $dbh = esmith::ConfigDB->open_ro('spamassassin')
|
||||
|| die "Unable to open spamassassin configuration dbase.";
|
||||
my %wbl = $dbh->get('wbl.global_to')->props;
|
||||
|
||||
$OUT = '';
|
||||
my $parameter = "";
|
||||
my $value = "";
|
||||
while (($parameter,$value) = each(%wbl)) {
|
||||
if ($parameter eq "type") {next;}
|
||||
|
||||
if ($value eq "White") {
|
||||
$OUT .= "whitelist_to " . $parameter . "\n";
|
||||
} elsif ($value eq "Black") {
|
||||
$OUT .= "blacklist_to " . $parameter . "\n";
|
||||
}
|
||||
}
|
||||
}
|
5
root/etc/e-smith/templates/etc/rsyslog.conf/32spamd
Normal file
5
root/etc/e-smith/templates/etc/rsyslog.conf/32spamd
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
#spamd
|
||||
:programname, isequal, "spamd" /var/log/spamd/spamd.log
|
||||
& stop
|
||||
|
@@ -0,0 +1,18 @@
|
||||
{
|
||||
|
||||
# Default options to spamd
|
||||
#SPAMDOPTIONS="-c -m5 -H --razor-home-dir='/var/lib/razor/' --razor-log-file='sys-syslog'"
|
||||
# previous sme9 options
|
||||
# -u spamd --syslog=stderr --ipv4-only
|
||||
my @args = qw(-u spamd -c -m5 -H --ipv4-only --razor-home-dir='/var/lib/razor/' --razor-log-file='sys-syslog');
|
||||
|
||||
my $bayes = $spamassassin{'UseBayes'} || '0';
|
||||
my $tell = $spamassassin{'SpamLearning'} || 'disabled';
|
||||
|
||||
if ($bayes =~ m/^1|yes|on|enabled$/ && $tell =~ m/^1|yes|on|enabled$/){
|
||||
push @args, '--allow-tell';
|
||||
}
|
||||
|
||||
$OUT .= "SPAMDOPTIONS=\"@args\"";
|
||||
|
||||
}
|
Reference in New Issue
Block a user