Discussion:
Email parsing with Python
(too old to reply)
djwallis81
2004-07-08 15:17:15 UTC
Permalink
I know there have been posts about this before but I am a python newbie and
if someone can help I would appreciate it. I have a server running exim as
its MTA. My users want to setup auto-reply messages and It sucks that I
have to manually do it everytime. 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! I know there is an email parser in python but i am a
newbie and its kind of tough understanding all that. Can someone shoot me
in the right direction? or perhaps sample code that I can modify ? Will
appreciate it very much
William Park
2004-07-08 19:14:01 UTC
Permalink
Post by djwallis81
I know there have been posts about this before but I am a python
newbie and if someone can help I would appreciate it. I have a server
running exim as its MTA. My users want to setup auto-reply messages
and It sucks that I have to manually do it everytime. 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!
I know there is an email parser in python but i am a newbie and its
kind of tough understanding all that. Can someone shoot me in the
right direction? or perhaps sample code that I can modify ? Will
appreciate it very much
man vacation
--
William Park, Open Geometry Consulting, <***@yahoo.ca>
Toronto, Ontario, Canada
Paul Wright
2004-07-08 19:47:58 UTC
Permalink
Post by William Park
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:
http://www.python.org/doc/current/lib/module-email.html
--
Paul Wright | http://pobox.com/~pw201 | http://blog.noctua.org.uk/
Reply address is valid but discards mail with attachments: send plain text only
djwallis81
2004-07-27 11:34:26 UTC
Permalink
I figured it out. created an ***@mydomain.com and Wrote a script in
php that parses the email then creates a file in the users home directory
to activate forwarding, also sends a confirmation email. Does the same for
remove. Can send it if you are interested - ***@hotmail.com
djwallis81
2004-07-27 11:44:57 UTC
Permalink
I figured it out. created an ***@mydomain.com and Wrote a script in
php that parses the email then creates a file in the users home directory
to activate forwarding, also sends a confirmation email. Does the same for
remove. Can send it if you are interested - ***@hotmail.com
Loading...