Email parsing with Python

Paul Wright -$P-W$- at
Thu Jul 8 21:47:58 CEST 2004

In article <2l5knoF8vevgU1 at>, William Park wrote:
>> I have written a python script that does all the needful (i.e. file
>> creation, modification etc) in Exim however I wanted to create an
>> email address on my server that the user would send email to activate
>> aut-reply. For instance if the subject of that email is autoreply -
>> 10/10/2004 I want to read the subject and activate autreply
>> immediately and end on 10/10/2004. Also the message body will be what
>> the auto reply text is! 
> man vacation

The OP already knows how to do that in Exim, he wants to know how to
parse email.

I'd have a look at the email module which comes with Python
2.2 and above (if I remember rightly). You could just pipe email to the 
relevant address to your script using Exim's "pipe" command in the
forward file for the address which will receive the activation emails.
I have scripts which do this. The documentation for the email module is
quite good and should tell you all you need:

Paul Wright | |
Reply address is valid but discards mail with attachments: send plain text only

More information about the Python-list mailing list