It can be useful to query spamassassin database and learn bayes basing on results
In this batch file an example , we scan for messages that have RRWL_D in the report and then invoke sa-learn on the file using find on the message number (it is very simple to use also for learn spam) :
# hamlearn.sh
# Daily scheduled it train spamassassin regard some selected messages
# Put in cron
# 05 04 * * * /batch/hamlearn.sh
# Variables
Q="/var/spool/MailScanner/quarantine" # Quarantine folder
L="/usr/bin/sa-learn --ham --no-sync" # Message learn command
# START
# Retrieve in array m all message id that have RRWL_D in spamreport
vsql="SELECT id FROM maillog WHERE spamreport LIKE '%RRWL_D%';"
m=( $( echo $vsql | mysql -N -u root -p<YOURPASSWORD> -D mailscanner ) )
# Scan array and learn ham
for i in ${m[@]}; do
# Learn
find $Q -type f -name $i | $L
done
Batch Learn
Re: Batch Learn
Nicola,
You should make one definitive post for the RRWL feature. You have posts everywhere and newcomers might find it confusing.
Include the latest code and features (like using the batch learn script above)
You should make one definitive post for the RRWL feature. You have posts everywhere and newcomers might find it confusing.
Include the latest code and features (like using the batch learn script above)
- shawniverson
- Posts: 3783
- Joined: 13 Jan 2014 23:30
- Location: Indianapolis, Indiana USA
- Contact: