pythonemailmbox

Properties of mbox message in mbox module in Python


I trying my luck to manage my mailbox with python.

My example code is

for eachmail in mailbox.mbox(mboxfile):
    print eachmail['From']

I got following by printing entire content.

Delivered-To
Subject
To
Content-Type
MIME-Version
Message-Id

Is there any full document showing what are all the properties I can get from the mbox message instance? Python docs doesn't specify any of these http://docs.python.org/library/mailbox.html#mailbox.mbox


Solution

  • It depends entirely on what headers are in the message. Most of them are optional. Check RFC 2076 for common ones.