class documentation

class StringListMailbox: (source)

Constructor: StringListMailbox(msgs)

Implements interfaces: twisted.mail.interfaces.IMailboxPOP3

View In Hierarchy

An in-memory mailbox.

Method __init__ No summary
Method deleteMessage Mark a message for deletion.
Method getMessage Return an in-memory file-like object with the contents of a message.
Method getUidl Get a unique identifier for a message.
Method listMessages 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 messages marked for deletion.
Method undeleteMessages Undelete any messages which have been marked for deletion.
Instance Variable msgs See __init__.
Instance Variable _delete The indices of messages which have been marked for deletion.
def __init__(self, msgs): (source)
Parameters
msgs:list of bytesThe contents of each message in the mailbox.
def deleteMessage(self, i): (source)

Mark a message for deletion.

Parameters
i:intThe 0-based index of a message to delete.
Raises
IndexErrorWhen the index does not correspond to a message in the mailbox.
def getMessage(self, i: int) -> IO[bytes]: (source)

Return an in-memory file-like object with the contents of a message.

Parameters
i:intThe 0-based index of a message.
Returns
IO[bytes]An in-memory file-like object containing the message.
Raises
IndexErrorWhen the index does not correspond to a message in the mailbox.
def getUidl(self, i): (source)

Get a unique identifier for a message.

Parameters
i:intThe 0-based index of a message.
Returns
bytesA hash of the contents of the message at the given index.
Raises
IndexErrorWhen the index does not correspond to a message in the mailbox.
def listMessages(self, i=None): (source)

Retrieve the size of a message, or, if none is specified, the size of each message in the mailbox.

Parameters
i:int or NoneThe 0-based index of a message.
Returns
int or list of intThe number of octets in the specified message, or, if an index is not specified, a list of the number of octets in each message in the mailbox. Any value which corresponds to a deleted message is set to 0.
Raises
IndexErrorWhen the index does not correspond to a message in the mailbox.
def sync(self): (source)

Discard the contents of any messages marked for deletion.

def undeleteMessages(self): (source)

Undelete any messages which have been marked for deletion.

_delete: set of int = (source)

The indices of messages which have been marked for deletion.