POP3 Filter

Richie Hindle richie at entrian.com
Mon Sep 27 07:46:59 EDT 2004


[crystal1]
> Has anyone created a python script that listens on the default POP3 port
> for incoming mail, kills certain messages based on a criteria, and
> forwards the output to a non-standard port the POP3 server is listening on?

[Harry]
> Check spambayes
> http://spambayes.sourceforge.net/

The SpamBayes POP3 proxy only annotates messages; it doesn't kill them.
Killing them isn't easily possible, because a typical POP3 conversation looks
like this:

Client: "How many messages are there?"
Server: "Two"
Client: "Give me message number 1"
Server: "Here it is: ..."
Client: "Give me message number 2"
Server: "Here it is: ..."
Client: "Thanks, bye."

The only way you can kill messages is to download them all at the start of the
conversation and decide which ones you need to kill.  That's unreasonable for
many people's setups.

SpamBayes' approach is to add a header (X-Spambayes-Classification) or to
annotate an existing header (Subject or To) and let the user use his email
client to filter the messages based on the annotation.  (This has the added
benefit that the user has the option of reviewing the proxy's decisions and
correcting them if it makes a mistake.)

-- 
Richie Hindle
richie at entrian.com




More information about the Python-list mailing list