POP3 Filter

C

crystal1

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?
 
W

William Park

crystal1 said:
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?

I think you may be confused about SMTP and POP3.
 
R

Richie Hindle

[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.)
 
R

Ross Boylan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,007
Messages
2,570,266
Members
46,863
Latest member
montyonthebonty

Latest Threads

Top