Deprecated since version 2.6: The mhlib module has been removed in Python 3.0. Use the mailbox instead.
The mhlib module provides a Python interface to MH folders and their contents.
The module contains three basic classes, MH, which represents a particular collection of folders, Folder, which represents a single folder, and Message, which represents a single message.
Message objects represent individual messages in a folder. The Message class is derived from mimetools.Message.
MH instances have the following methods:
Print an error message – can be overridden.
Return a profile entry (None if not set).
Return the mailbox pathname.
Return the current folder name.
Set the current folder name.
Return a list of top-level folders.
Return a list of all folders.
Return a list of direct subfolders of the given folder.
Return a list of all subfolders of the given folder.
Create a new folder.
Delete a folder – must have no subfolders.
Return a new open folder object.
Folder instances represent open folders and have the following methods:
Print an error message – can be overridden.
Return the folder’s full pathname.
Return the full pathname of the folder’s sequences file.
Return the full pathname of message n of the folder.
Return a list of messages in the folder (as numbers).
Return the current message number.
Set the current message number to n.
Parse msgs syntax into list of messages.
Get last message, or 0 if no messages are in the folder.
Set last message (internal use only).
Return dictionary of sequences in folder. The sequence names are used as keys, and the values are the lists of message numbers in the sequences.
Return dictionary of sequences in folder name: list.
Remove messages in list from folder.
Move messages in list to other folder.
Move one message to a given destination in another folder.
Copy one message to a given destination in another folder.
The Message class adds one method to those of mimetools.Message:
Return a new open message object (costs a file descriptor).