Email parsing with Python

D

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
 
W

William Park

djwallis81 said:
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
 
P

Paul Wright

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
 
D

djwallis81

I figured it out. created an (e-mail address removed) 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 - (e-mail address removed)
 
D

djwallis81

I figured it out. created an (e-mail address removed) 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 - (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top