class documentation

Undocumented

Method __init__ Undocumented
Method addMessage Add the given message to this mailbox.
Method close Close this mailbox.
Method destroy Called before this mailbox is deleted, permanently.
Method expunge Remove all messages flagged \Deleted.
Method fetch Retrieve one or more messages.
Method getFlags Return the flags defined in this mailbox
Method getHierarchicalDelimiter Get the character which delimits namespaces for in this mailbox.
Method getMessageCount Return the number of messages in this mailbox.
Method getRecentCount Return the number of messages with the 'Recent' flag.
Method getUID Return the UID of a message in the mailbox
Method getUIDNext Return the likely UID for the next message added to this mailbox.
Method getUIDValidity Return the unique validity identifier for this mailbox.
Method getUnseenCount Return the number of messages with the 'Unseen' flag.
Method isWriteable Get the read/write status of the mailbox.
Method requestStatus Return status information about this mailbox.
Method store Set the flags of one or more messages.
Class Variable flags Undocumented
Class Variable messages Undocumented
Class Variable mUID Undocumented
Class Variable rw Undocumented
Instance Variable addListener Add a mailbox change listener
Instance Variable closed Undocumented
Instance Variable listeners Undocumented
Instance Variable removeListener Remove a mailbox change listener
def __init__(self): (source)

Undocumented

def addMessage(self, message, flags, date=None): (source)

Add the given message to this mailbox.

Parameters
message:A file-like objectThe RFC822 formatted message
flags:Any iterable of bytesThe flags to associate with this message
date:bytesIf specified, the date to associate with this message.
Returns
DeferredA deferred whose callback is invoked with the message id if the message is added successfully and whose errback is invoked otherwise.
Raises
ReadOnlyMailboxRaised if this Mailbox is not open for read-write.
def close(self): (source)

Close this mailbox.

Returns
A Deferred which fires when this mailbox has been closed, or None if the mailbox can be closed immediately.
def destroy(self): (source)

Called before this mailbox is deleted, permanently.

If necessary, all resources held by this mailbox should be cleaned up here. This function _must_ set the \Noselect flag on this mailbox.

def expunge(self): (source)

Remove all messages flagged \Deleted.

Returns
list or DeferredThe list of message sequence numbers which were deleted, or a Deferred whose callback will be invoked with such a list.
Raises
ReadOnlyMailboxRaised if this Mailbox is not open for read-write.
def fetch(self, messages, uid): (source)

Retrieve one or more messages.

Parameters
messages:MessageSetThe identifiers of messages to retrieve information about
uid:boolIf true, the IDs specified in the query are UIDs; otherwise they are message sequence IDs.
Returns
Any iterable of two-tuples of message sequence numbers and implementors of IMessageIMAP.Undocumented
def getFlags(self): (source)

Return the flags defined in this mailbox

Flags with the \ prefix are reserved for use as system flags.

Returns
list of strA list of the flags that can be set on messages in this mailbox.
def getHierarchicalDelimiter(self): (source)

Get the character which delimits namespaces for in this mailbox.

Returns
bytesUndocumented
def getMessageCount(self): (source)

Return the number of messages in this mailbox.

Returns
intUndocumented
def getRecentCount(self): (source)

Return the number of messages with the 'Recent' flag.

Returns
intUndocumented
def getUID(self, message): (source)

Return the UID of a message in the mailbox

Parameters
message:intThe message sequence number
Returns
intThe UID of the message.
def getUIDNext(self): (source)

Return the likely UID for the next message added to this mailbox.

Returns
intUndocumented
def getUIDValidity(self): (source)

Return the unique validity identifier for this mailbox.

Returns
intUndocumented
def getUnseenCount(self): (source)

Return the number of messages with the 'Unseen' flag.

Returns
intUndocumented
def isWriteable(self): (source)

Get the read/write status of the mailbox.

Returns
intA true value if write permission is allowed, a false value otherwise.
def requestStatus(self, names): (source)

Return status information about this mailbox.

Mailboxes which do not intend to do any special processing to generate the return value, statusRequestHelper can be used to build the dictionary by calling the other interface methods which return the data for each name.

Parameters
names:Any iterableThe status names to return information regarding. The possible values for each name are: MESSAGES, RECENT, UIDNEXT, UIDVALIDITY, UNSEEN.
Returns
dict or DeferredA dictionary containing status information about the requested names is returned. If the process of looking this information up would be costly, a deferred whose callback will eventually be passed this dictionary is returned instead.
def store(self, messages, flags, mode, uid): (source)

Set the flags of one or more messages.

Parameters
messages:A MessageSet object with the list of messages requestedThe identifiers of the messages to set the flags of.
flags:sequence of strThe flags to set, unset, or add.
mode:-1, 0, or 1If mode is -1, these flags should be removed from the specified messages. If mode is 1, these flags should be added to the specified messages. If mode is 0, all existing flags should be cleared and these flags should be added.
uid:boolIf true, the IDs specified in the query are UIDs; otherwise they are message sequence IDs.
Returns
dict or DeferredA dict mapping message sequence numbers to sequences of str representing the flags set on the message after this operation has been performed, or a Deferred whose callback will be invoked with such a dict.
Raises
ReadOnlyMailboxRaised if this mailbox is not open for read-write.
flags: tuple[str, ...] = (source)

Undocumented

Undocumented

Undocumented

Undocumented

addListener = (source)

Add a mailbox change listener

Parameters
listenerAn object to add to the set of those which will be notified when the contents of this mailbox change.

Undocumented

listeners: list = (source)

Undocumented

removeListener = (source)

Remove a mailbox change listener

Parameters
listenerThe object to remove from the set of listeners.
Raises
ValueErrorRaised when the given object is not a listener for this mailbox.