473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

POP3 Filter

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?

Jul 18 '05 #1
4 1925
Check spambayes
http://spambayes.sourceforge.net/

-Harry
On Fri, 24 Sep 2004 11:11:43 -0700, crystal1 <cr******@spamless.net> 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?

--
http://mail.python.org/mailman/listinfo/python-list

Jul 18 '05 #2
crystal1 <cr******@spamless.net> 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?


I think you may be confused about SMTP and POP3.

--
William Park <op**********@yahoo.ca>
Open Geometry Consulting, Toronto, Canada
Jul 18 '05 #3

[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
ri****@entrian.com

Jul 18 '05 #4
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.
Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lev Altshuler | last post by:
Hi, I am trying to count email messages in the mailbox and read their headers. In case that there are some messages on the POP3 server and they haven't yet got to the Inbox, I get a number of...
0
by: Eric McDaniel | last post by:
This may be a question for ActiveState support, but just in case anyone out there knows what the problem is... My call to Net::POP3->new() works fine when run through the perl interpreter, but...
8
by: Captain Nemo | last post by:
Hi I would like to write my own anti-spam filter (for Windows 98) but I've no idea how you intercept the incoming POP3 stream. Can anyone recommend a book (or webpage) that could get me...
2
by: Mike Brearley | last post by:
I need to write a script that will check a catch-all mailbox (pop3) and send a non delivery report back to the sender of the email. Background info: I have a domain hosted on a site that offers...
1
by: Kevin F | last post by:
I have the following script: emails = for msg in messagesInfo: msgNum = int(msg.split()) msgSize = int(msg.split()) if(msgSize < 20000): message = server.retr(msgNum) Message =...
4
by: bill | last post by:
I am in preliminary design of a contact management program. The user would like to use his current mail server (POP3 - remote). I have done some reading on the IMAP functions but am unclear if...
9
by: flit | last post by:
Hello All, Using poplib in python I can extract only the headers using the .top, there is a way to extract only the message text without the headers? like remove the fields below: "...
0
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Like many people, I normally use Yahoo! Mail via the web and like to keep all my emails stored on the Yahoo! server. However sometimes I can’t get access to a PC/the web and I download my emails...
5
by: Craig Buchanan | last post by:
I would like to monitor a POP3 mailbox with multiple clients. However, I want to ensure that each message is processed by only one client. In essence, I would like to treat a POP3 mailbox like a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.