class documentation
class Mailbox: (source)
Known subclasses: twisted.mail.maildir.MaildirMailbox
Implements interfaces: twisted.mail.interfaces.IMailboxPOP3
A base class for mailboxes.
Method | delete |
Mark a message for deletion. |
Method | get |
Retrieve a file containing the contents of a message. |
Method | get |
Get a unique identifier for a message. |
Method | list |
Retrieve the size of a message, or, if none is specified, the size of each message in the mailbox. |
Method | sync |
Discard the contents of any message marked for deletion. |
Method | undelete |
Undelete all messages marked for deletion. |
overridden in
twisted.mail.maildir.MaildirMailbox
Mark a message for deletion.
This must not change the number of messages in this mailbox. Further requests for the size of the deleted message should return 0. Further requests for the message itself may raise an exception.
Parameters | |
i:int | The 0-based index of a message. |
Raises | |
ValueError or IndexError | When the index does not correspond to a message in the mailbox. The use of ValueError is preferred. |
overridden in
twisted.mail.maildir.MaildirMailbox
Retrieve a file containing the contents of a message.
Parameters | |
i:int | The 0-based index of a message. |
Returns | |
file-like object | A file containing the message. |
Raises | |
ValueError or IndexError | When the index does not correspond to a message in the mailbox. The use of ValueError is preferred. |
overridden in
twisted.mail.maildir.MaildirMailbox
Get a unique identifier for a message.
Parameters | |
i:int | The 0-based index of a message. |
Returns | |
bytes | A string of printable characters uniquely identifying the message for all time. |
Raises | |
ValueError or IndexError | When the index does not correspond to a message in the mailbox. The use of ValueError is preferred. |
overridden in
twisted.mail.maildir.MaildirMailbox
Retrieve the size of a message, or, if none is specified, the size of each message in the mailbox.
Parameters | |
i:int or None | The 0-based index of the message. |
Returns | |
int , sequence of int , or Deferred | The number of octets in the specified message, or, if an index is not specified, a sequence of the number of octets for all messages in the mailbox or a deferred which fires with one of those. Any value which corresponds to a deleted message is set to 0. |
Raises | |
ValueError or IndexError | When the index does not correspond to a message in the mailbox. The use of ValueError is preferred. |
overridden in
twisted.mail.maildir.MaildirMailbox
Undelete all messages marked for deletion.
Any message which can be undeleted should be returned to its original position in the message sequence and retain its original UID.