The ProcImap package provides an API for the IMAP protocol, subclassing from the mailbox and email packages provided by the Python standard library.
In addition, ProcImap contains a number of “utility” functions and classes, targeted for automatic processing/filtering of email messages inside an IMAP mailbox.