initial commit of file from CVS for smeserver-learn on Sat Sep 7 20:30:28 AEST 2024

This commit is contained in:
Trevor Batley
2024-09-07 20:30:28 +10:00
parent 931fa41b7f
commit 6a26018715
41 changed files with 586 additions and 2 deletions

1
root/etc/cron.d/Learn Normal file
View File

@@ -0,0 +1 @@
# Learn auto-exec disabled

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1 @@
daily

View File

@@ -0,0 +1 @@
service

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1 @@
LearnAsHam

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
[HAM]

View File

@@ -0,0 +1 @@
service

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1 @@
LearnAsSpam

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
[SPAM]

View File

@@ -0,0 +1 @@
service

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1 @@
LearnInWL

View File

@@ -0,0 +1 @@
disabled

View File

@@ -0,0 +1 @@
[WL]

View File

@@ -0,0 +1 @@
service

View File

@@ -0,0 +1 @@
1

View File

@@ -0,0 +1 @@
enabled

View File

@@ -0,0 +1,20 @@
#!/bin/bash
# default is 0, if kept to 0 we can not play there
/sbin/e-smith/db configuration setprop spamassassin UseBayes 1
# default is empty, we shall set it if we want to have a run
/sbin/e-smith/config getprop spamassassin BayesAutoLearnThresholdSpam >/dev/null|| /sbin/e-smith/config setprop spamassassin BayesAutoLearnThresholdSpam 6.00
/sbin/e-smith/config getprop spamassassin BayesAutoLearnThresholdNonspam >/dev/null|| /sbin/e-smith/config setprop spamassassin BayesAutoLearnThresholdNonspam 0.10
# we really need spamassassin running
/sbin/e-smith/config setprop spamassassin status enabled
# default is 0 for no reject
#/sbin/e-smith/config setprop spamassassin RejectLevel 12
# default is 5
#/sbin/e-smith/config setprop spamassassin TagLevel 4
# default is medium
#/sbin/e-smith/config setprop spamassassin Sensitivity custom

View File

@@ -0,0 +1,6 @@
#!/bin/bash
sa-learn --sync --dbpath /var/spool/spamd/.spamassassin -u spamd
chown spamd.spamd /var/spool/spamd/.spamassassin/bayes_*
chown spamd.spamd /var/spool/spamd/.spamassassin/bayes.mutex
chmod 640 /var/spool/spamd/.spamassassin/bayes_*

View File

@@ -0,0 +1 @@
PERMS=0644

View File

@@ -0,0 +1,17 @@
{
my $freq = $Learn{cron} || 'none';
my $min = int(rand(60));
my $hour = int(rand(5));
my $learn = '/usr/bin/Learn.pl';
if ($freq eq 'hourly') {
return "$min * * * * root $learn\n";
} elsif ($freq eq 'daily') {
return "$min $hour * * * root $learn\n";
} elsif ($freq eq 'weekly') {
return "$min $hour * * 0 root $learn\n";
} elsif ($freq eq 'monthly') {
return "$min $hour 15 * * root $learn\n";
} else {
return "# Learn auto-exec disabled\n";
}
}