multifile and mimetools to parse email folder

Matthew Dixon Cowles matt at mondoinfo.com
Mon Jun 4 23:03:58 EDT 2001


On Tue, 05 Jun 2001 01:39:31 GMT, rdskar1 at home.com <rdskar1 at home.com>
wrote:

>I want to read through an email folder (I use mutt on debian, the
>'folder' is a text file) and decode the attachments. I understand how
>mimetools works, but I am having trouble moving from message to
>message with multifile.

I think that multifile isn't meant for moving from message to message
in a mailbox. It's intended for moving from part to part of a
multipart MIME message. I think that the mailbox module may help you
go from message to message.

Once you've got a message, you'll need to determine if it's
MIME-encoded and, if it is, whether it's a mutipart message, and do
the right thing in each case. When I was figuring out how to do MIME
decoding in Python, I found Oleg Broytmann's code very helpful. You
might want to have a look in:

http://phd.pp.ru/Software/Python/

Of course, you're welcome to steal from my code too. It's buried
in an MUA that's at:

http://www.visi.com/~mdc/swallow/

Regards,
Matt



More information about the Python-list mailing list