script to read emails and extract attachments from cron

Dan M dan at wolf.com
Mon Feb 6 16:30:06 EST 2006


On Mon, 06 Feb 2006 10:57:23 -0800, JohnRHarlow at gmail.com wrote:

> 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



More information about the Python-list mailing list