Lisp to Python translation criticism?

Erik Max Francis max at
Tue Aug 20 02:17:37 CEST 2002

Paul Rubin wrote:

> The main thing about filtering is to never automatically delete
> messages even if they're marked as spam.  Instead, divert them to a
> spam bucket file.  I do this on a variety of addresses and make a
> point of looking at the bucket every now and then.  Every once in a
> while I find something that shouldn't have been filtered.

Indeed.  Deleting spamcaught messages without any tracking system is
asking for trouble.

> I'd like to get around to setting up my filter to automatically mail
> me a "daily spam digest" showing the From/Date/Subject headers and the
> first line or two of text of spam filtered that day.  Even with 100
> spams, it doesn't take more than a minute or so to glance over the
> list, and dealing with it all at once is a lot less headache than
> being interrupted dozens of times during the day.  At that point I can
> make my filters quite a bit more aggressive.  If a legitimate message
> gets filtered, it's still almost certain that I'll see it the same
> day, just not immediately.

In my new Python/qmail solution, I simply log the results to a file
which gives an indication of what the messages is and why:

2002/08/19 16:51:38 -8   | "Free Copy of your Credit Report": ""
port at> | insist[RECIPIENTS/<somebody at whatever\.com>];
(remove|unsubsc?ribe)]; bad[BODY/click (reply|here|now)];
bad[BODY/\bno[- \]risk
\b]; bad[BODY/e-?mail market(er|ing)]; bad[SENDER/free];
bad[subject/credit (bureau|report)]; bad[subject/your credit]

Then I just tail -f | cut -b -79 the file and glance at the xterm
occasionally.  So far I've gotten very few false positives with the new
system; the prior system, using procmailsc, had trouble with accounting
since I couldn't really tell which of the rules matched and why.

 Erik Max Francis / max at /
 __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/  \ There is nothing so subject to the inconstancy of fortune as war.
\__/ Miguel de Cervantes
    Church /
 A lambda calculus explorer in Python.

More information about the Python-list mailing list