473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Email parsing with Python

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

Jul 18 '05 #1
4 3138
djwallis81 <wd****@private.com> wrote:
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, <op**********@yahoo.ca>
Toronto, Ontario, Canada
Jul 18 '05 #2
In article <2l************@uni-berlin.de>, 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:
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
Jul 18 '05 #3
I figured it out. created an au*******@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 - dj********@hotmail.com

Jul 18 '05 #4
I figured it out. created an au*******@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 - dj********@hotmail.com

Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Gerrit Holl | last post by:
Posted with permission from the author. I have some comments on this PEP, see the (coming) followup to this message. PEP: 321 Title: Date/Time Parsing and Formatting Version: $Revision: 1.3 $...
2
by: Boris Boutillier | last post by:
Hi all, I'm looking for parsing a Verilog file in my python module, is there already such a tool in python (a module in progress) to help instead of doing a duplicate job. And do you know of...
3
by: dont bother | last post by:
Hey, I have been trying to parse emails: But I could not find any examples or snippets of parsing emails in python from the documentation. Google did not help me much too. I am trying to...
3
by: dont bother | last post by:
Hi, I have written this small piece of code. I am a brand new player of Python. I had asked some people for help, unfortunately not many helped. Here is the code I have: import email import...
2
by: Todd Moyer | last post by:
I would like to use Python to parse a *python-like* data description language. That is, it would have it's own keywords, but would have a syntax like Python. For instance: Ob1 ('A'): Ob2...
0
by: Barry Warsaw | last post by:
Python 2.4 final will probably be released in a few hours so this seems like a good time to release the standalone email package, version 3.0 final. Unless there's some last second snafu, this...
9
by: ankitdesai | last post by:
I would like to parse a couple of tables within an individual player's SHTML page. For example, I would like to get the "Actual Pitching Statistics" and the "Translated Pitching Statistics"...
1
by: mneagul | last post by:
Hello, I want to use email.Parser for parsing some email messages but I have a small problem: it is very, very slow... For 110MB of email messages it takes ~29-30 seconds for parsing. Do you...
0
by: Ahmed, Shakir | last post by:
Thanks everyone who tried to help me to parse incoming email from an exchange server: Now, I am getting following error; I am not sure where I am doing wrong. I appreciate any help how to resolve...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.