How can i write in python or ruby a script to do content filtering in postfix via smtp or uucp (not pipe)? There is some examples?
A:
If you don't need the whole mail body to process it, you could simply write a policy server for Postfix, see Access policy delegation.
If you need to process the whole mail, you have several possibilities, see Postfix Content Inspection.
You could either implement a content filter (see FILTER_README) which gets the mail via SMTP or LMTP and, after processing it, sends it back to Postfix through SMTP, or you could implement a milter, for which appropriate libraries for Python exist.
joschi
2010-09-07 05:58:13
Yes, i know that, but i am asking for an example of simple content filter..
tapioco123
2010-09-08 06:10:34
Check the examples that come with the Python milter library (e. g. ppymilter).
joschi
2010-09-08 06:32:33