twisted.mail.interfaces.IMailboxIMAP(IMailboxIMAPInfo)
interface documentationtwisted.mail.interfaces
(View In Hierarchy)
Known implementations: twisted.mail.test.test_imap.SimpleMailbox, twisted.mail.test.test_imap.UncloseableMailbox
Method | getUIDValidity | Return the unique validity identifier for this mailbox. |
Method | getUIDNext | Return the likely UID for the next message added to this mailbox. |
Method | getUID | Return the UID of a message in the mailbox |
Method | getMessageCount | Return the number of messages in this mailbox. |
Method | getRecentCount | Return the number of messages with the 'Recent' flag. |
Method | getUnseenCount | Return the number of messages with the 'Unseen' flag. |
Method | isWriteable | Get the read/write status of the mailbox. |
Method | destroy | Called before this mailbox is deleted, permanently. |
Method | requestStatus | Return status information about this mailbox. |
Method | addListener | Add a mailbox change listener |
Method | removeListener | Remove a mailbox change listener |
Method | addMessage | Add the given message to this mailbox. |
Method | expunge | Remove all messages flagged \Deleted. |
Method | fetch | Retrieve one or more messages. |
Method | store | Set the flags of one or more messages. |
Inherited from IMailboxIMAPInfo:
Method | getFlags | Return the flags defined in this mailbox |
Method | getHierarchicalDelimiter | Get the character which delimits namespaces for in this mailbox. |
Return the likely UID for the next message added to this mailbox.
Returns | (type: int ) |
Get the read/write status of the mailbox.
Returns | A true value if write permission is allowed, a false value otherwise. (type: int ) |
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.
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 | The status names to return information regarding. The possible values for each name are: MESSAGES, RECENT, UIDNEXT, UIDVALIDITY, UNSEEN. (type: Any iterable) |
Returns | A 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. (type: dict
or Deferred ) |
Add a mailbox change listener
Parameters | listener | An object to add to the set of those which will be notified when the
contents of this mailbox change. (type: Any object which implements IMailboxIMAPListener ) |
Remove a mailbox change listener
Parameters | listener | The object to remove from the set of listeners. (type: Any object previously added to and not removed from this mailbox as a listener.) |
Raises | ValueError | Raised when the given object is not a listener for this mailbox. |
Add the given message to this mailbox.
Parameters | message | The RFC822 formatted message (type: A file-like object) |
flags | The flags to associate with this message (type: Any iterable of bytes ) | |
date | If specified, the date to associate with this message. (type: bytes ) | |
Returns | A deferred whose callback is invoked with the message id if the message is
added successfully and whose errback is invoked otherwise. (type: Deferred ) | |
Raises | ReadOnlyMailbox | Raised if this Mailbox is not open for read-write. |
Retrieve one or more messages.
Parameters | messages | The identifiers of messages to retrieve information about (type: MessageSet ) |
uid | If true, the IDs specified in the query are UIDs; otherwise they are
message sequence IDs. (type: bool ) | |
Returns | (type: Any iterable of two-tuples of message sequence numbers and implementors of
IMessageIMAP .) |
Set the flags of one or more messages.
Parameters | messages | The identifiers of the messages to set the flags of. (type: A MessageSet object with the list of messages requested) |
flags | The flags to set, unset, or add. (type: sequence of str ) | |
mode | If 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. (type: -1, 0, or 1) | |
uid | If true, the IDs specified in the query are UIDs; otherwise they are
message sequence IDs. (type: bool ) | |
Returns | A 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 . (type: dict
or Deferred ) | |
Raises | ReadOnlyMailbox | Raised if this mailbox is not open for read-write. |