Extracting email attachment when is_multipart() is False

John J. Lee jjl at pobox.com
Wed Nov 26 20:53:37 CET 2003


Derrick 'dman' Hudson <dman at dman13.dyndns.org> writes:
> On Wed, 26 Nov 2003 08:06:15 +0100, Davor Cengija wrote:
[...]
> >> You seem to be missing the RFC 822 headers (From, To, Subject, etc.).
> > 
> > Yes, that's true. The question is if it's easier to write a parser for that
> > kind of messages or to force the message producing application to output the
> > headers as well. We'll see...
> 
> You have a third option, which I would try if you can't get the
> message producer to do it correctly:  slap some RFC822 headers on the
> beginning, and then ignore them in the parsed message object.  After
[...]

Or read the docs & code for the email module, to figure out how to
persuade it to take the messages without the headers.


John




More information about the Python-list mailing list