mailbox.Maildir.lock()

lock() unlock() Maildir mailboxes do not support (or require) locking, so these methods do nothing.

mailbox.Maildir.list_folders()

list_folders() Return a list of the names of all folders.

mailbox.Maildir.get_folder()

get_folder(folder) Return a Maildir instance representing the folder whose name is folder. A NoSuchMailboxError exception is raised if the folder does not exist.

mailbox.Maildir.get_file()

get_file(key) Depending upon the host platform, it may not be possible to modify or remove the underlying message while the returned file remains open.

mailbox.Maildir.flush()

flush() All changes to Maildir mailboxes are immediately applied, so this method does nothing.

mailbox.Maildir.close()

close() Maildir instances do not keep any open files and the underlying mailboxes do not support locking, so this method does nothing.

mailbox.Maildir.clean()

clean() Delete temporary files from the mailbox that have not been accessed in the last 36 hours. The Maildir specification says that mail-reading programs should do this occasionally.

mailbox.Maildir.add_folder()

add_folder(folder) Create a folder whose name is folder and return a Maildir instance representing it.

mailbox.Maildir.add()

add(message) __setitem__(key, message) update(arg) Warning These methods generate unique file names based upon the current process ID. When using multiple threads, undetected name clashes may occur and cause corruption of the mailbox unless threads are coordinated to avoid using these methods to manipulate the same mailbox simultaneously.

mailbox.Maildir

class mailbox.Maildir(dirname, factory=None, create=True) A subclass of Mailbox for mailboxes in Maildir format. Parameter factory is a callable object that accepts a file-like message representation (which behaves as if opened in binary mode) and returns a custom representation. If factory is None, MaildirMessage is used as the default message representation. If create is True, the mailbox is created if it does not exist. It is for historical reasons that dirname is named as such rather tha