mailbox.MH.close()

close() MH instances do not keep any open files, so this method is equivalent to unlock().

mailbox.MH.add_folder()

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

mailbox.MH

class mailbox.MH(path, factory=None, create=True) A subclass of Mailbox for mailboxes in MH 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, MHMessage is used as the default message representation. If create is True, the mailbox is created if it does not exist. MH is a directory-based mailbox format invented for the MH Message Handling System, a m

mailbox.Message

class mailbox.Message(message=None) A subclass of the email.message module’s Message. Subclasses of mailbox.Message add mailbox-format-specific state and behavior. If message is omitted, the new instance is created in a default, empty state. If message is an email.message.Message instance, its contents are copied; furthermore, any format-specific information is converted insofar as possible if message is a Message instance. If message is a string, a byte string, or a file, it should contain

mailbox.mboxMessage.set_from()

set_from(from_, time_=None) Set the “From ” line to from_, which should be specified without a leading “From ” or trailing newline. For convenience, time_ may be specified and will be formatted appropriately and appended to from_. If time_ is specified, it should be a time.struct_time instance, a tuple suitable for passing to time.strftime(), or True (to use time.gmtime()).

mailbox.mboxMessage.set_flags()

set_flags(flags) Set the flags specified by flags and unset all others. Parameter flags should be the concatenation in any order of zero or more occurrences of each of 'R', 'O', 'D', 'F', and 'A'.

mailbox.mboxMessage.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.

mailbox.mboxMessage.get_from()

get_from() Return a string representing the “From ” line that marks the start of the message in an mbox mailbox. The leading “From ” and the trailing newline are excluded.

mailbox.mboxMessage.get_flags()

get_flags() Return a string specifying the flags that are currently set. If the message complies with the conventional format, the result is the concatenation in the following order of zero or one occurrence of each of 'R', 'O', 'D', 'F', and 'A'.

mailbox.mboxMessage.add_flag()

add_flag(flag) Set the flag(s) specified by flag without changing other flags. To add more than one flag at a time, flag may be a string of more than one character.