script to read emails and extract attachments from cron

J

JohnRHarlow

Hi:

I am looking for advice on the best way to set up a process to read
incoming emails (from a normal unix mailbox on the same host)
containing a gzipped telemetry attachment. I'd like the script to
extract the attachment into a directory where another process will pick
it up. I plan to run it every minute out of cron, so it would probably
start by moving the mbox file to another name so that incoming emails
and later instances of itself won't be affected.

I'm new to Python (I've mostly tweaked other scripts until now) and
just looking for advice on how to put such a program together. I'm
particularly interested in how to deal with encoded binary attachments.

Thanks
John
 
D

Dan M

Hi:

I am looking for advice on the best way to set up a process to read
incoming emails (from a normal unix mailbox on the same host)
containing a gzipped telemetry attachment. I'd like the script to
extract the attachment into a directory where another process will pick
it up. I plan to run it every minute out of cron, so it would probably
start by moving the mbox file to another name so that incoming emails
and later instances of itself won't be affected.

You might want to take a look at
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/86675 and
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/86676

I'm using those two recipes for a project very similar to what you
described.

Dan
 

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,981
Messages
2,570,187
Members
46,730
Latest member
AudryNolan

Latest Threads

Top