IMAP and Outlook Spam training: Difference between revisions
No edit summary |
Greenrenault (talk | contribs) (Linked to wrong bug, oops) |
||
Line 1: | Line 1: | ||
IMAP/Outlook move to junk doesn't train anti-spam - It seems that when you move a mail to junk folder on IMAP client (like Thunderbird) anti-spam filter on MTA does not use that mail as a spam example for training... See http://bugzilla.zimbra.com/show_bug.cgi?id= | IMAP/Outlook move to junk doesn't train anti-spam - It seems that when you move a mail to junk folder on IMAP client (like Thunderbird) anti-spam filter on MTA does not use that mail as a spam example for training... See http://bugzilla.zimbra.com/show_bug.cgi?id=9532 | ||
Here is a bash script created from the comments against this bug. I have tested it on our system and it appears to work OK. Feel free to contribute and enhance! Full credit for this script is due to bobby@zimbra.com and dmangot@terracottatech.com who wrote the bits which I just pasted together! | Here is a bash script created from the comments against this bug. I have tested it on our system and it appears to work OK. Feel free to contribute and enhance! Full credit for this script is due to bobby@zimbra.com and dmangot@terracottatech.com who wrote the bits which I just pasted together! | ||
Line 34: | Line 34: | ||
That should be it :) | That should be it :) | ||
Revision as of 02:37, 7 March 2008
IMAP/Outlook move to junk doesn't train anti-spam - It seems that when you move a mail to junk folder on IMAP client (like Thunderbird) anti-spam filter on MTA does not use that mail as a spam example for training... See http://bugzilla.zimbra.com/show_bug.cgi?id=9532
Here is a bash script created from the comments against this bug. I have tested it on our system and it appears to work OK. Feel free to contribute and enhance! Full credit for this script is due to bobby@zimbra.com and dmangot@terracottatech.com who wrote the bits which I just pasted together!
#!/bin/bash wikiuser=`zmprov getConfig zimbraNotebookAccount | cut -d ' ' -f 2`; hamuser=`zmprov getConfig zimbraSpamIsNotSpamAccount | cut -d ' ' -f 2`; spamuser=`zmprov getConfig zimbraSpamIsSpamAccount | cut -d ' ' -f 2`; users=`zmprov getAllAccounts | grep -v -e $wikiuser -e $hamuser -e $spamuser`; for zuser in $users do echo "Train spam for $zuser" /opt/zimbra/bin/zmtrainsa $zuser spam junk done echo "Zimbra spam training complete"
To install, save the above script as 'learnmorespam.sh', copy to /opt/zimbra/learnmorespam.sh on your Zimbra server. Set ownership and make executable:
[root@mail ~]# chmod +x /opt/zimbra/learnmorespam.sh [root@mail ~]# chown zimbra:zimbra /opt/zimbra/learnmorespam.sh
And then create this crontab entry, /etc/crontab
#Learn more spam 6am daily 0 6 * * * zimbra /opt/zimbra/learnmorespam.sh > /dev/null 2>&1
That should be it :)