mailbox.MH.remove_folder()

remove_folder(folder) Delete the folder whose name is folder. If the folder contains any messages, a NotEmptyError exception will be raised and the folder will not be deleted.

mailbox.MH.remove()

remove(key) __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.pack()

pack() Rename messages in the mailbox as necessary to eliminate gaps in numbering. Entries in the sequences list are updated correspondingly. Note Already-issued keys are invalidated by this operation and should not be subsequently used.

mailbox.MH.lock()

lock() 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.list_folders()

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

mailbox.MH.get_sequences()

get_sequences() Return a dictionary of sequence names mapped to key lists. If there are no sequences, the empty dictionary is returned.

mailbox.MH.get_folder()

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

mailbox.MH.get_file()

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

mailbox.MH.flush()

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

mailbox.MH.discard()

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.