| [message]) |
Ifmessage is omitted, the new instance is created in a default, emptystate. Ifmessage is anemail.Message.Message instance, itscontents are copied; furthermore, any format-specific information is convertedinsofar as possible ifmessage is aMessage instance. Ifmessage is a string or a file, it should contain anRFC 2822-compliantmessage, which is read and parsed.
The format-specific state and behaviors offered by subclasses vary, but ingeneral it is only the properties that are not specific to a particular mailboxthat are supported (although presumably the properties are specific to aparticular mailbox format). For example, file offsets for single-file mailboxformats and file names for directory-based mailbox formats are not retained,because they are only applicable to the original mailbox. But state such aswhether a message has been read by the user or marked as important is retained,because it applies to the message itself.
There is no requirement thatMessage instances be used to representmessages retrieved usingMailbox instances. In some situations, thetime and memory required to generateMessage representations might notnot acceptable. For such situations,Mailbox instances also offerstring and file-like representations, and a custom message factory may bespecified when aMailbox instance is initialized.