[Wylug-help] Mail attachment processing

Daniel Walker danielwalker at fastmail.fm
Fri Nov 14 16:52:18 GMT 2003


James Holden (Wylug) wrote:
>
> Hello all,
>
> Does anybody know of a utility that I can pipe mail through and have it
> automatically save attachments as files, so that they can be processed.
>
> I fancy having a go at putting pictures from my camera phone onto my
> website automatically, but just emailing them from the phone to a
> special address.

I agree with Gary, but I'd use python. I've had some success doing
similar things using the python email functions - they're very simple to
use.

http://www.python.org/doc/current/lib/module-email.html

You can basically grab the example code, parse the msg and then use
message.get_payload() to write it out. It should be easy as presumably
the mails are coming in a known format, although I suppose some
flexibility will allow you to cope with a wider variety of formats -
this shouldn't be hard either.

Sadlt I can't show you my code as it is (c) my old company - and on a
practical level, I no longer have access to it!

Dan





More information about the Wylug-help mailing list