t.m.p.IMailbox(Interface) : interface documentation

Part of twisted.mail.pop3 View Source View In Hierarchy

Known implementations: twisted.mail.pop3.Mailbox

An interface for mailbox access.

Message indices are 0-based.

Instance Variable loginDelay The number of seconds between allowed logins for the user associated with this mailbox. (type: int)
Instance Variable messageExpiration The number of days messages in this mailbox will remain on the server before being deleted. (type: int)
Method listMessages Retrieve the size of a message, or, if none is specified, the size of each message in the mailbox.
Method getMessage Retrieve a file containing the contents of a message.
Method getUidl Get a unique identifier for a message.
Method deleteMessage Mark a message for deletion.
Method undeleteMessages Undelete all messages marked for deletion.
Method sync Discard the contents of any message marked for deletion.
loginDelay =
The number of seconds between allowed logins for the user associated with this mailbox. (type: int)
messageExpiration =
The number of days messages in this mailbox will remain on the server before being deleted. (type: int)
def listMessages(index=None): (source)
Retrieve the size of a message, or, if none is specified, the size of each message in the mailbox.
ParametersindexThe 0-based index of the message. (type: int or NoneType)
ReturnsThe 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. (type: int, sequence of int, or Deferred)
RaisesValueError or IndexErrorWhen the index does not correspond to a message in the mailbox. The use of ValueError is preferred.
def getMessage(index): (source)
Retrieve a file containing the contents of a message.
ParametersindexThe 0-based index of a message. (type: int)
ReturnsA file containing the message. (type: file-like object)
RaisesValueError or IndexErrorWhen the index does not correspond to a message in the mailbox. The use of ValueError is preferred.
def getUidl(index): (source)
Get a unique identifier for a message.
ParametersindexThe 0-based index of a message. (type: int)
ReturnsA string of printable characters uniquely identifying the message for all time. (type: bytes)
RaisesValueError or IndexErrorWhen the index does not correspond to a message in the mailbox. The use of ValueError is preferred.
def deleteMessage(index): (source)
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.

ParametersindexThe 0-based index of a message. (type: int)
RaisesValueError or IndexErrorWhen the index does not correspond to a message in the mailbox. The use of ValueError is preferred.
def undeleteMessages(): (source)
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.

def sync(): (source)
Discard the contents of any message marked for deletion.
API Documentation for Twisted, generated by pydoctor at 2015-01-30 14:14:53.