combining mailbox and email modules

Matthew Dixon Cowles matt at
Wed Sep 25 14:58:54 EDT 2002

On Wed, 25 Sep 2002 06:36:29 GMT, Bob Horvath <nospam at>

> I am having trouble figuring out how to get the mailbox and email
> modules to play together so that I can use email module functions on
> every mail in the mailbox.  Is there a way to feed a factory from
> the email module to mailbox module?

Yes, there is:

>>> import mailbox
>>> import email
>>> i=mailbox.Maildir("Mail/testmail",email.message_from_file)
<email.Message.Message instance at 0x812410c>
<email.Message.Message instance at 0x8124224>


More information about the Python-list mailing list