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