[EMAIL PROTECTED] wrote:
Hello everyone,
I'm wondering if anyone has setup something similar to, like an email
address of mails that are considered spam, and cron out sa-learn or pipe
to a program that will do the same?

Other ideas on ways to feed sa-learn are appreciated.


I use this over IMAP:

$ cat ~/bin/sa-learn.sh
#!/bin/bash

for file in `ls -1 ~/.maildir/.sa-learn.spam/cur/`; do
        cat ~/.maildir/.sa-learn.spam/cur/$file | sa-learn --spam
        rm -f ~/.maildir/.sa-learn.spam/cur/$file
done

for file in `ls -1 ~/.maildir/.sa-learn.ham/cur`; do
        cat ~/.maildir/.sa-learn.ham/cur/$file | sa-learn --spam
        rm -f ~/.maildir/.sa-learn.ham/cur/$file
done
$ crontab -e
0 * * * * ~/bin/sa-learn.sh

With the sa-learn.[spam|ham] folders, the "." makes them collapsible in Thunderbird, so helps keep it a little cleaner. Then when I get a spam mail from anyone that fails the SA rules, I just move it to the sa-learn.spam folder.

You could do the same thing with a reply to a specific address (e.g. [EMAIL PROTECTED]) but that won't preserve the headers of the email. The script above running on an IMAP server will preserve all your spam email headers for SA to learn from.

This is a quick and dirty way to run sa-learn. It works for my personal mail server, but if you want this to run on a larger scale, I'd recommend editing the script to do something besides removing the spam mail, and checking to make sure sa-learn didn't error out for some reason.

Hope this helps

Chris Frederick



Reply via email to