I am using Courier IMAP and maildir format, so I created the following
script which is kicked off periodically via cron.
#!/bin/bash
# ${HOME}/.spamassassin/sa-learn.sh
MAIL_DIR=${HOME}/.maildir/
GOOD_DIR=${MAIL_DIR}/.Spam.Process.Good
SPAM_DIR=${MAIL_DIR}/.Spam.Process.Bad
SA_LEARN=/usr/bin/sa-learn
if [ ! -x ${SA_LEARN} ]; then
exit 0
fi
if [ -d ${SPAM_DIR} ]; then
cd ${SPAM_DIR}/cur
FILES=`ls`
for f in ${FILES}; do
cat ${f} | ${SA_LEARN} --spam &> /dev/null
rm -f ${f}
done
fi
if [ -d ${GOOD_DIR} ]; then
cd ${GOOD_DIR}/cur
FILES=`ls`
for f in ${FILES}; do
cat ${f} | ${SA_LEARN} --ham &> /dev/null
rm -f ${f}
done
fi
Tom Veldhouse
----- Original Message -----
From: "Andy Zbikowski (Zibby)" <zibby+tclug at ringworld.org>
To: "TCLUG Mailing List" <tclug-list at mn-linux.org>
Sent: Wednesday, November 05, 2003 2:39 PM
Subject: Re: [TCLUG] Spam-Assassin and Bayes Learning
> Being the lazy type, I hashed out a script to take care of sa-learn tasks
> for me. All I do is sort my mail into sa.caught (where caught spam gets
> dumped), sa.notcaught (where I move spam messages that spam assassin
> didn't catch), and sa.falsepositive (for false positives.)
>
> The false positives usually prompt me to move things around and run my
> script. Like I said, I'm lazy.
>
> sa-learn --no-rebuild --ham --mbox sa.falsepositive
> sa-learn --no-rebuild --spam --mbox sa.notcaught
> sa-learn --rebuild
>
> I do the rebuild of the database seperatly so I can fire off the first two
> commands and walk away while the rebuild finishes. Better things to do
> than wait around to run the next command...
>
>
> Andrew S. Zbikowski | http://www.ringworld.org
> A password is like your underwear; Change it
> frequently, don't share it with others, and
> don't ask to borrow someone else's.
>
>
>
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> http://www.mn-linux.org tclug-list at mn-linux.org
> https://mailman.real-time.com/mailman/listinfo/tclug-list
>
>
_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list