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
Revision as of 01:19, 19 September 2013 by Bob (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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