Has anyone written a script that run sa-learn through an IMAP folder?

Yes. Try this one:


$ cat trainbayes
# !/bin/bash
sa-learn --no-rebuild --ham --dir /home/mail/amavis/maildir/.ham/cur/
sa-learn --no-rebuild --spam --dir /home/mail/amavis/maildir/.spam/cur/
sa-learn --rebuild

If the IMAP server and the SpamAssassin host are not the same machine, you can first transfer the mailboxes with "mailutil" (from the uw-imapd distribution):


rm -f spamfolder hamfolder
mailutil copy '{imaphost/user=foo}#shared/spamfolder' spamfolder
mailutil copy '{imaphost/user=foo}#shared/hamfolder' hamfolder
sa-learn --no-rebuild --spam --mbox spamfolder
sa-learn --no-rebuild --ham --mbox hamfolder
sa-learn --rebuild

You can make this work without needing to give a password with some careful SSH configuration, or you can use anonymous IMAP mode if you don't care that the whole world could read your spam and ham.

-Kevin




------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to