# ``twisted`.`mail`.`maildir`.`StringListMailbox``

class documentation

`class StringListMailbox: (source)`

Implements interfaces: `twisted.mail.interfaces.IMailboxPOP3`

View In Hierarchy

An in-memory mailbox.

Method | `__init__` |
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 `bytes` | The contents of each message in the mailbox.

def deleteMessage(self, i): (source)
from `twisted.mail.interfaces.IMailboxPOP3`
Mark a message for deletion.

Parameters
i:`int` | The 0-based index of a message to delete.
Raises
`IndexError` | When the index does not correspond to a message in the mailbox.

def getMessage(self, i): (source)
from `twisted.mail.interfaces.IMailboxPOP3`
Return an in-memory file-like object with the contents of a message.

Parameters
i:`int` | The 0-based index of a message.
Returns
`IO[bytes]` | An in-memory file-like object containing the message.
Raises
`IndexError` | When the index does not correspond to a message in the mailbox.

def getUidl(self, i): (source)
from `twisted.mail.interfaces.IMailboxPOP3`
Get a unique identifier for a message.

Parameters
i:`int` | The 0-based index of a message.
Returns
`bytes` | A hash of the contents of the message at the given index.
Raises
`IndexError` | When the index does not correspond to a message in the mailbox.

def listMessages(self, i=None): (source)
from `twisted.mail.interfaces.IMailboxPOP3`
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 a message.
Returns
`int` or `list` of `int` | The 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
`IndexError` | When the index does not correspond to a message in the mailbox.

def sync(self): (source)
from `twisted.mail.interfaces.IMailboxPOP3`
Discard the contents of any messages marked for deletion.
def undeleteMessages(self): (source)
from `twisted.mail.interfaces.IMailboxPOP3`
Undelete any messages which have been marked for deletion.
msgs = (source)
See `__init__`.
_delete: `set` of `int` = (source)
The indices of messages which have been marked for deletion.