POP3 Filter

Ross Boylan RossBoylan at stanfordalumni.org
Sat Oct 9 11:02:54 CEST 2004


On Fri, 24 Sep 2004 11:11:43 -0700, crystal1 wrote:

> Not sure if this has been done...
> 
> 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?
> 
> Upon recieving requests from a sender, the script would transparently
> forward traffic to the off port unless a violating condition is encountered.
> 
> I'd like to use the listening python script to check for a correct 'to:'
>   address format, attachment size limit, etc.
> 
> Before I waste too much time, do you think this is do-able?

It's doable, and has been done.  For example, I use mailfilter (though
I don't think it's in python).

POP3 does allow you to kill individual messages before downloading
them.  The problem is that, if you want to avoid downloading them, you
can't get too much info.  I think it would be possible to be cleverer
than mailfilter, since (at least some) POP servers can give you the
start of a message without giving you the whole thing.





More information about the Python-list mailing list