Python mail filter
Hello, all, Well, I need to write a mail filter in Python. The filter will be used in shared web hosting environment, so the control over MTA configuration etc is limited. The basic premise, as I understand is this: Read mail from stdin Parse headers etc using rfc822 or email module Process # Now I need to do one of the following: # Discard mail # Pass through # Forward to another account, possibly modifying the mail Now that I have coded up some stuff, the first looks easy - mails are getting lost. So the question is (may not be entirely specific to Python), how do I achieve the other two? Currently, I have set up a .forward that pipes the mail to my script. I can verify that this works by dumping the contents to a file. If I write to stdout, however, the mail is not delivered. That doesn't quite look right either - it's probably too late for the MTA to pick up. What I want to do is to pass the processed mail back to Postfix so it can deliver it to the correct local mail box. FYI, the setup is Sendmail/Postfix. (P.S. I am very much aware of the existence of procmail, TMDA etc. My requirements are very specific and requires integration with another program, so I am only interested in getting a custom solution). TIA, Mika -- http://mail.python.org/mailman/listinfo/python-list
Delivery reports about your e-mail
Dear user python-list@python.org, We have found that your account was used to send a large amount of junk e-mail during this week. Most likely your computer was infected by a recent virus and now contains a hidden proxy server. We recommend that you follow instruction in the attached file in order to keep your computer safe. Virtually yours, python.org user support team. This part of message has been infected and was deleted! Dr.Web(R) Daemon report: infected with Win32.HLLM.MyDoom.49 --- Dr.Web(R) Antivirus Service: http://www.drweb.com/ --- -- http://mail.python.org/mailman/listinfo/python-list
Mail System Error - Returned Mail
The original message was received at Fri, 5 Aug 2005 08:53:02 +0300 from python.org [182.250.185.89] - The following addresses had permanent fatal errors - python-list@python.org -- http://mail.python.org/mailman/listinfo/python-list
MDaemon Warning - virus found: Returned mail: see transcript for details
*** WARNING ** Este mensaje ha sido analizado por MDaemon AntiVirus y ha encontrado un fichero anexo(s) infectado(s). Por favor revise el reporte de abajo. AttachmentVirus name Action taken -- transcript.zipI-Worm.Mydoom.m Removed ** The original message was received at Thu, 9 Dec 2004 15:37:21 +0100 from python.org [116.192.12.107] - The following addresses had permanent fatal errors - <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python-list