18 Aug
2004
18 Aug
'04
8:47 a.m.
On Tue, 17 Aug 2004 23:40:53 +0100, Keith Edmunds <keith@midnighthax.com> wrote:
Run a daily (or nightly) cron job to run something like (this is for Maildir mailboxes with spam in a "_SPAM" folder, but you can adapt it as required):
Might want to add a delay on that or only match messages that have been Seen, otherwise it'll classify mail that hasn't been read yet. Maybe..
find /home/*/Maildir/*/ -type d -name cur | while read cur; do
foldername=dirname "$cur"
find "$cur" -type f -name '*,*S*' | while read file; do
if [ x"$foldername" = x"_SPAM" ]; then
sa-learn --spam "$file"
else
sa-learn --ham "$file"
fi
done
done
On second thought, you probably don't want to feed sa-learn every message, every day - just the new ones, right? ..
Zach.