mailbox.mboxMessage

class mailbox.mboxMessage(message=None) A message with mbox-specific behaviors. Parameter message has the same meaning as with the Message constructor. Messages in an mbox mailbox are stored together in a single file. The sender’s envelope address and the time of delivery are typically stored in a line beginning with “From ” that is used to indicate the start of a message, though there is considerable variation in the exact format of this data among mbox implementations. Flags that indicate

mailbox.mbox.unlock()

unlock() Three locking mechanisms are used—dot locking and, if available, the flock() and lockf() system calls.

mailbox.mbox.lock()

lock() unlock() Three locking mechanisms are used—dot locking and, if available, the flock() and lockf() system calls.

mailbox.mbox.get_file()

get_file(key) Using the file after calling flush() or close() on the mbox instance may yield unpredictable results or raise an exception.

mailbox.mbox

class mailbox.mbox(path, factory=None, create=True) A subclass of Mailbox for mailboxes in mbox 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, mboxMessage is used as the default message representation. If create is True, the mailbox is created if it does not exist. The mbox format is the classic format for storing mail on Unix systems. All messa

mailbox.MaildirMessage.set_subdir()

set_subdir(subdir) Set the subdirectory the message should be stored in. Parameter subdir must be either “new” or “cur”.

mailbox.MaildirMessage.set_info()

set_info(info) Set “info” to info, which should be a string.

mailbox.MaildirMessage.set_flags()

set_flags(flags) Set the flags specified by flags and unset all others.

mailbox.MaildirMessage.set_date()

set_date(date) Set the delivery date of the message to date, a floating-point number representing seconds since the epoch.

mailbox.MaildirMessage.remove_flag()

remove_flag(flag) Unset the flag(s) specified by flag without changing other flags. To remove more than one flag at a time, flag maybe a string of more than one character. If “info” contains experimental information rather than flags, the current “info” is not modified.