Using python with postfix pipe.

08.06.2008 13:56

posted by: Benjamin Smith

Posted Under: , ,

Dear Lazyweb,

I was wondering if anyone here had experience with using a postfix pipe to a python program for processing mails. Most of my background in mail processing is with qmail, Perl and procmail.

From what I can tell there appears to be a ‘pipe’ command that I could use in an alias to point it at my python program, then use the ‘email.FeedParser’ class to keep it from blocking. For now I’m parsing mails from the maildir via the ‘email.Parser’ class, then moving them around. It would be very nice to process them as they come in. This would eliminate overhead from firing up python whenever I want to parse messages and make my process somewhat real time.

Any ideas/snippets/caveats are greatly appreciated!

P.S. I’m doing this in python to hook into byteflow, the django app powering this site.

5 comments | 0 pingbacks
More Posts: