PyMOTW: mailbox

The mailbox module defines a common API for accessing email messages stored in local disk formats, including Maildir, mbox, MH, Babyl, and MMDF. There are base classes for Mailbox and Message, and each mailbox format includes a corresponding pair of subclasses to implement the details for that format.

Read more at mailbox