Attention: All pages of this wiki depend on the pages that come before it, in order as they are listed on the Main Page. Please check for Dependencies.
Please also look at What You Need to Know Before Using This Wiki

/root/scripts/LearnAsSpam.sh

From COCNM
Jump to navigation Jump to search
#!/bin/sh

DT=$(date "+%F %T")
VPD=/home/mail

for i in $(ls /home/mail); do
        echo "$DT spam training for account $i" >> /var/log/LearnAsSpam.log
        /usr/local/bin/sa-learn --spam $VPD/$i/Maildir/.LearnAsSpam/cur/* >> /var/log/LearnAsSpam.log
        /usr/local/bin/sa-learn --ham $VPD/$i/Maildir/.Sent/cur/* >> /var/log/LearnAsSpam.log
        /usr/local/bin/doveadm expunge -u $i mailbox LearnAsSpam savedbefore 1s >> /var/log/LearnAsSpam.log
        echo "$DT account $i spam deleted" >> /var/log/LearnAsSpam.log
done