<<< Date Index >>>     <<< Thread Index >>>

Re: faster spamassassin macro?



On Fri, Oct 10, 2003 at 12:18:40AM +0200, Joel Aufrecht wrote:

> There are two problems.  First, even if I put two ^ms in the macro, I
> still have to manually hit return at the "Press any key to
> continue..." prompt to exit the shell.  So it's a two-step process
> instead of one-step.  Second, the whole thing takes a few seconds, so
> it's annoying to tag spam in my inbox.  Is there some way to spin this
> off in the background so that it doesn't interrupt mail reading?  Or,
> second-best, a way to batch-process a bunch of tagged messages through
> spam-assassin and then delete them?

What I do is, first of all, set wait_key=no :)
My spam macro looks like this: "<save-message>=newspam\n"
My ham macro looks like this:  "<copy-message>=ham\n<save-message>"
So, whenever I have a false positive, I toss it in the newspam folder,
and I try to save some non-spam data for the spam-training too.  So
any time I save something from my inbox to a backup folder, I copy it
into a special "ham" folder.

Then I run a spam-learning script from my cron.daily.  It runs the
messages from newspam through as spam, and the messages from ham
through as non-spam.  Then it deletes all messages from those two
folders.  (for mbox folders, echo>mailbox, for maildirs, rm
maildir/cur/*)

I imagine this script would work just fine running after each mail
session, but since I leave my mailhost on all the time, it suits me to
run it every day at 6am or whatever.

HTH,
 Allister

Attachment: spamlearn.sh
Description: Bourne shell script