mailbox.MMDF.get_file()

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

mailbox.MMDF

class mailbox.MMDF(path, factory=None, create=True) A subclass of Mailbox for mailboxes in MMDF 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, MMDFMessage is used as the default message representation. If create is True, the mailbox is created if it does not exist. MMDF is a single-file mailbox format invented for the Multichannel Memorandum Dis

mailbox.MHMessage.set_sequences()

set_sequences(sequences) Set the list of sequences that include this message.

mailbox.MHMessage.remove_sequence()

remove_sequence(sequence) Remove sequence from the list of sequences that include this message.

mailbox.MHMessage.get_sequences()

get_sequences() Return a list of the names of sequences that include this message.

mailbox.MHMessage.add_sequence()

add_sequence(sequence) Add sequence to the list of sequences that include this message.

mailbox.MHMessage

class mailbox.MHMessage(message=None) A message with MH-specific behaviors. Parameter message has the same meaning as with the Message constructor. MH messages do not support marks or flags in the traditional sense, but they do support sequences, which are logical groupings of arbitrary messages. Some mail reading programs (although not the standard mh and nmh) use sequences in much the same way flags are used with other formats, as follows: Sequence Explanation unseen Not read, but previous

mailbox.MH.__delitem__()

__delitem__(key) discard(key) These methods immediately delete the message. The MH convention of marking a message for deletion by prepending a comma to its name is not used.

mailbox.MH.unlock()

unlock() Three locking mechanisms are used—dot locking and, if available, the flock() and lockf() system calls. For MH mailboxes, locking the mailbox means locking the .mh_sequences file and, only for the duration of any operations that affect them, locking individual message files.

mailbox.MH.set_sequences()

set_sequences(sequences) Re-define the sequences that exist in the mailbox based upon sequences, a dictionary of names mapped to key lists, like returned by get_sequences().