How do I teach Spam Assassin?

Steve Searle mail at stevesearle.com
Tue Mar 16 20:19:53 UTC 2004


Around 07:25pm on Tuesday, March 16, 2004 (UK time), Jonathan Gardner scrawled:

> $ crontab -e
> Add the lines:
> 
> 5 1 * * * sa-learn --ham --mbox /var/spool/mail/<your username>
> 5 2 * * * sa-learn --spam --mbox ~/mail/Junk
> 5 3 * * * sa-leran --ham --mbox ~/mail/archive
> 
> and save the file.

Unless you empty your mailboxes elsewhere, you are repeatedly running the
same mail through sa-learn.

I use crontab to exexute the following script (which I copied from
somewhere on the web.

#!/bin/sh

HAMBOX=$HOME/.mutt/trash
SPAMBOX=$HOME/.mutt/spam

[ -w $HAMBOX ] || exit 1
[ -w $SPAMBOX ] || exit 1

echo Learning ham ...

if sa-learn --mbox --ham $HAMBOX
then
  cat /dev/null > $HAMBOX
fi

echo Learning spam ...

if sa-learn --mbox --spam $SPAMBOX
then
  cat /dev/null > $SPAMBOX
fi

Cheers

Steve

-- 
 
(o<     www.stevesearle.com
//\     Powered by Red Hat Linux
V_/_    No MS products were used in the creation of this message
 
  8:16pm  up 10 days,  5:42,  1 user,  load average: 0.07, 0.08, 0.04
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20040316/370512cc/attachment-0002.bin 


More information about the users mailing list