C# Class MailKit.Net.Imap.ImapFolder

An IMAP folder.
An IMAP folder.
Inheritance: MailFolder
Mostrar archivo Open project: jstedfast/MailKit Class Usage Examples

Private Properties

Property Type Description
AsReadOnly IList
BuildQueryExpression string
BuildSortOrder string
ESearchMatches void
FormatDateTime string
FormatSummaryItems string
GetBodyPartQuery string
GetFetchRange string
GetHeaderNames HashSet
IsAscii bool
LabelListToString string
ModifyFlags IList
ModifyFlags IList
ModifyLabels IList
ModifyLabels IList
OnExists void
OnExpunge void
OnFetch void
OnRecent void
OnVanished void
ParseEntity MimeKit.MimeEntity
ParseMessage MimeKit.MimeMessage
QResyncFetch void
QueueAppend ImapCommand
QueueMultiAppend ImapCommand
ReadLiteralData void
ReadStringToken string
SearchMatches void
SelectOrExamine string
ThreadMatches void
UntaggedAcl void
UntaggedListRights void
UntaggedMyRights void
UntaggedQuota void
UntaggedQuotaRoot void
UpdateAcceptedFlags void
UpdateAppendLimit void
UpdateAttributes void
UpdateHighestModSeq void
UpdateIsNamespace void
UpdatePermanentFlags void
UpdateUidNext void
UpdateUidValidity void
UpdateUnread void

Public Methods

Method Description
AddAccessRights ( string name, AccessRights rights, CancellationToken cancellationToken = default(CancellationToken) ) : void

Add access rights for the specified identity.

Adds the given access rights for the specified identity.

AddFlags ( IList uids, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Adds a set of flags to the specified messages only if their mod-sequence value is less than the specified value.

Adds a set of flags to the specified messages only if their mod-sequence value is less than the specified value.

AddFlags ( IList indexes, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Adds a set of flags to the specified messages only if their mod-sequence value is less than the specified value.

Adds a set of flags to the specified messages only if their mod-sequence value is less than the specified value.

AddFlags ( IList uids, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Adds a set of flags to the specified messages.

Adds a set of flags to the specified messages.

AddFlags ( IList indexes, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Adds a set of flags to the specified messages.

Adds a set of flags to the specified messages.

AddLabels ( IList uids, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Add a set of labels to the specified messages only if their mod-sequence value is less than the specified value.

Adds a set of labels to the specified messages only if their mod-sequence value is less than the specified value.

AddLabels ( IList indexes, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Add a set of labels to the specified messages only if their mod-sequence value is less than the specified value.

Adds a set of labels to the specified messages only if their mod-sequence value is less than the specified value.

AddLabels ( IList uids, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Add a set of labels to the specified messages.

Adds a set of labels to the specified messages.

AddLabels ( IList indexes, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Add a set of labels to the specified messages.

Adds a set of labels to the specified messages.

Append ( MimeKit.FormatOptions options, IList messages, IList flags, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList

Appends the specified messages to the folder.

Appends the specified messages to the folder and returns the UniqueIds assigned to the messages.

Append ( MimeKit.FormatOptions options, IList messages, IList flags, IList dates, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList

Appends the specified messages to the folder.

Appends the specified messages to the folder and returns the UniqueIds assigned to the messages.

Append ( MimeKit.FormatOptions options, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : UniqueId?

Appends the specified message to the folder.

Appends the specified message to the folder and returns the UniqueId assigned to the message.

Append ( MimeKit.FormatOptions options, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : UniqueId?

Appends the specified message to the folder.

Appends the specified message to the folder and returns the UniqueId assigned to the message.

BuildQuery ( StringBuilder builder, SearchQuery query, List args, bool parens, bool &ascii ) : void
Check ( CancellationToken cancellationToken = default(CancellationToken) ) : void

Force the server to sync its in-memory state with its disk state.

The CHECK command forces the IMAP server to sync its in-memory state with its disk state.

For more information about the CHECK command, see rfc350101.

CheckState ( bool open, bool rw ) : void
Close ( bool expunge = false, CancellationToken cancellationToken = default(CancellationToken) ) : void

Closes the folder, optionally expunging the messages marked for deletion.

Closes the folder, optionally expunging the messages marked for deletion.

CopyTo ( IList uids, IMailFolder destination, CancellationToken cancellationToken = default(CancellationToken) ) : UniqueIdMap

Copies the specified messages to the destination folder.

Copies the specified messages to the destination folder.

CopyTo ( IList indexes, IMailFolder destination, CancellationToken cancellationToken = default(CancellationToken) ) : void

Copies the specified messages to the destination folder.

Copies the specified messages to the destination folder.

Create ( string name, IEnumerable specialUses, CancellationToken cancellationToken = default(CancellationToken) ) : IMailFolder

Creates a new subfolder with the given name.

Creates a new subfolder with the given name.

Create ( string name, bool isMessageFolder, CancellationToken cancellationToken = default(CancellationToken) ) : IMailFolder

Creates a new subfolder with the given name.

Creates a new subfolder with the given name.

Delete ( CancellationToken cancellationToken = default(CancellationToken) ) : void

Deletes the folder on the IMAP server.

Deletes the folder on the IMAP server.

This method will not delete any child folders.
Expunge ( CancellationToken cancellationToken = default(CancellationToken) ) : void

Expunges the folder, permanently removing all messages marked for deletion.

The EXPUNGE command permanently removes all messages in the folder that have the MessageFlags.Deleted flag set.

For more information about the EXPUNGE command, see rfc3501.

Normally, a MailFolder.MessageExpunged event will be emitted for each message that is expunged. However, if the IMAP server supports the QRESYNC extension and it has been enabled via the ImapClient.EnableQuickResync(CancellationToken) method, then the MailFolder.MessagesVanished event will be emitted rather than the MailFolder.MessageExpunged event.
Expunge ( IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : void

Expunge the specified uids, permanently removing them from the folder.

Expunges the specified uids, permanently removing them from the folder.

If the IMAP server supports the UIDPLUS extension (check the ImapClient.Capabilities for the ImapCapabilities.UidPlus flag), then this operation is atomic. Otherwise, MailKit implements this operation by first searching for the full list of message uids in the folder that are marked for deletion, unmarking the set of message uids that are not within the specified list of uids to be be expunged, expunging the folder (thus expunging the requested uids), and finally restoring the deleted flag on the collection of message uids that were originally marked for deletion that were not included in the list of uids provided. For this reason, it is advisable for clients that wish to maintain state to implement this themselves when the IMAP server does not support the UIDPLUS extension.

For more information about the UID EXPUNGE command, see rfc4315.

Normally, a MailFolder.MessageExpunged event will be emitted for each message that is expunged. However, if the IMAP server supports the QRESYNC extension and it has been enabled via the ImapClient.EnableQuickResync(CancellationToken) method, then the MailFolder.MessagesVanished event will be emitted rather than the MailFolder.MessageExpunged event.
Fetch ( IList uids, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message UIDs.

Fetches the message summaries for the specified message UIDs.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList uids, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message UIDs.

Fetches the message summaries for the specified message UIDs.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList uids, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message UIDs.

Fetches the message summaries for the specified message UIDs.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList uids, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

If the IMAP server supports the QRESYNC extension and the application has enabled this feature via ImapClient.EnableQuickResync(CancellationToken), then this method will emit MailFolder.MessagesVanished events for messages that have vanished since the specified mod-sequence value.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList uids, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

If the IMAP server supports the QRESYNC extension and the application has enabled this feature via ImapClient.EnableQuickResync(CancellationToken), then this method will emit MailFolder.MessagesVanished events for messages that have vanished since the specified mod-sequence value.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList uids, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

If the IMAP server supports the QRESYNC extension and the application has enabled this feature via ImapClient.EnableQuickResync(CancellationToken), then this method will emit MailFolder.MessagesVanished events for messages that have vanished since the specified mod-sequence value.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList indexes, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message indexes.

Fetches the message summaries for the specified message indexes.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList indexes, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message indexes.

Fetches the message summaries for the specified message indexes.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList indexes, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message indexes.

Fetches the message summaries for the specified message indexes.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList indexes, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList indexes, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( IList indexes, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( int min, int max, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the messages between the two indexes, inclusive.

Fetches the message summaries for the messages between the two indexes, inclusive.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( int min, int max, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the messages between the two indexes, inclusive.

Fetches the message summaries for the messages between the two indexes, inclusive.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( int min, int max, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the messages between the two indexes, inclusive.

Fetches the message summaries for the messages between the two indexes, inclusive.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( int min, int max, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( int min, int max, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

Fetch ( int min, int max, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

FetchStream ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
FetchSummaryItems ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
GetAccessControlList ( CancellationToken cancellationToken = default(CancellationToken) ) : AccessControlList

Get the complete access control list for the folder.

Gets the complete access control list for the folder.

GetAccessRights ( string name, CancellationToken cancellationToken = default(CancellationToken) ) : AccessRights

Get the access rights for a particular identifier.

Gets the access rights for a particular identifier.

GetBodyPart ( UniqueId uid, BodyPart part, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity

Gets the specified body part.

Gets the specified body part.

GetBodyPart ( UniqueId uid, BodyPart part, bool headersOnly, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity

Gets the specified body part.

Gets the specified body part.

GetBodyPart ( UniqueId uid, string partSpecifier, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity

Gets the specified body part.

Gets the specified body part.

GetBodyPart ( UniqueId uid, string partSpecifier, bool headersOnly, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity

Gets the specified body part.

Gets the specified body part.

GetBodyPart ( int index, BodyPart part, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity

Gets the specified body part.

Gets the specified body part.

GetBodyPart ( int index, BodyPart part, bool headersOnly, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity

Gets the specified body part.

Gets the specified body part.

GetBodyPart ( int index, string partSpecifier, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity

Gets the specified body part.

Gets the specified body part.

GetBodyPart ( int index, string partSpecifier, bool headersOnly, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity

Gets the specified body part.

Gets the specified body part.

GetEnumerator ( ) : IEnumerator

Gets an enumerator for the messages in the folder.

Gets an enumerator for the messages in the folder.

GetMessage ( UniqueId uid, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeMessage

Gets the specified message.

Gets the specified message.

GetMessage ( int index, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeMessage

Gets the specified message.

Gets the specified message.

GetMetadata ( MetadataOptions options, IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : MetadataCollection

Gets the specified metadata.

Gets the specified metadata.

GetMetadata ( MetadataTag tag, CancellationToken cancellationToken = default(CancellationToken) ) : string

Gets the specified metadata.

Gets the specified metadata.

GetMyAccessRights ( CancellationToken cancellationToken = default(CancellationToken) ) : AccessRights

Get the access rights for the current authenticated user.

Gets the access rights for the current authenticated user.

GetQuota ( CancellationToken cancellationToken = default(CancellationToken) ) : FolderQuota

Get the quota information for the folder.

Gets the quota information for the folder.

To determine if a quotas are supported, check the ImapClient.SupportsQuotas property.

GetStream ( UniqueId uid, int offset, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream

Gets a substream of the specified message.

Fetches a substream of the message. If the starting offset is beyond the end of the message, an empty stream is returned. If the number of bytes desired extends beyond the end of the message, a truncated stream will be returned.

GetStream ( UniqueId uid, string section, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream

Gets a substream of the specified body part.

Gets a substream of the specified message.

For more information about how to construct the section, see Section 6.4.5 of RFC3501.

GetStream ( UniqueId uid, string section, int offset, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream

Gets a substream of the specified message.

Gets a substream of the specified message. If the starting offset is beyond the end of the specified section of the message, an empty stream is returned. If the number of bytes desired extends beyond the end of the section, a truncated stream will be returned.

For more information about how to construct the section, see Section 6.4.5 of RFC3501.

GetStream ( int index, int offset, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream

Gets a substream of the specified message.

Fetches a substream of the message. If the starting offset is beyond the end of the message, an empty stream is returned. If the number of bytes desired extends beyond the end of the message, a truncated stream will be returned.

GetStream ( int index, string section, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream

Gets a substream of the specified message.

Gets a substream of the specified message.

For more information about how to construct the section, see Section 6.4.5 of RFC3501.

GetStream ( int index, string section, int offset, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream

Gets a substream of the specified message.

Gets a substream of the specified message. If the starting offset is beyond the end of the specified section of the message, an empty stream is returned. If the number of bytes desired extends beyond the end of the section, a truncated stream will be returned.

For more information about how to construct the section, see Section 6.4.5 of RFC3501.

GetSubfolder ( string name, CancellationToken cancellationToken = default(CancellationToken) ) : IMailFolder

Gets the specified subfolder.

Gets the specified subfolder.

GetSubfolders ( StatusItems items, bool subscribedOnly = false, CancellationToken cancellationToken = default(CancellationToken) ) : IEnumerable

Gets the subfolders.

Gets the subfolders.

ImapFolder ( MailKit.Net.Imap.ImapFolderConstructorArgs args ) : System

Initializes a new instance of the MailKit.Net.Imap.ImapFolder class.

Creates a new ImapFolder.

If you subclass ImapFolder, you will also need to subclass ImapClient and override the ImapClient.CreateImapFolder(ImapFolderConstructorArgs) method in order to return a new instance of your ImapFolder subclass.

ModifyAccessRights ( string name, AccessRights rights, string action, CancellationToken cancellationToken ) : void
MoveTo ( IList uids, IMailFolder destination, CancellationToken cancellationToken = default(CancellationToken) ) : UniqueIdMap

Move the specified messages to the destination folder.

Moves the specified messages to the destination folder.

If the IMAP server supports the MOVE extension (check the ImapClient.Capabilities property for the ImapCapabilities.Move flag), then this operation will be atomic. Otherwise, MailKit implements this by first copying the messages to the destination folder, then marking them for deletion in the originating folder, and finally expunging them (see Expunge(IList<UniqueId>,CancellationToken) for more information about how a subset of messages are expunged). Since the server could disconnect at any point between those 3 (or more) commands, it is advisable for clients to implement their own logic for moving messages when the IMAP server does not support the MOVE command in order to better handle spontanious server disconnects and other error conditions.

MoveTo ( IList indexes, IMailFolder destination, CancellationToken cancellationToken = default(CancellationToken) ) : void

Moves the specified messages to the destination folder.

If the IMAP server supports the MOVE command, then the MOVE command will be used. Otherwise, the messages will first be copied to the destination folder and then marked as \Deleted in the originating folder. Since the server could disconnect at any point between those 2 operations, it may be advisable to implement your own logic for moving messages in this case in order to better handle spontanious server disconnects and other error conditions.

Open ( FolderAccess access, CancellationToken cancellationToken = default(CancellationToken) ) : FolderAccess

Opens the folder using the requested folder access.

Opens the folder using the requested folder access.

Open ( FolderAccess access, uint uidValidity, ulong highestModSeq, IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : FolderAccess

Opens the folder using the requested folder access.

This variant of the Open(FolderAccess,System.Threading.CancellationToken) method is meant for quick resynchronization of the folder. Before calling this method, the ImapClient.EnableQuickResync(CancellationToken) method MUST be called.

You should also make sure to add listeners to the MailFolder.MessagesVanished and MailFolder.MessageFlagsChanged events to get notifications of changes since the last time the folder was opened.

ProcessResponseCodes ( ImapCommand ic, IMailFolder folder ) : void
RemoveAccess ( string name, CancellationToken cancellationToken = default(CancellationToken) ) : void

Remove all access rights for the given identity.

Removes all access rights for the given identity.

RemoveAccessRights ( string name, AccessRights rights, CancellationToken cancellationToken = default(CancellationToken) ) : void

Remove access rights for the specified identity.

Removes the given access rights for the specified identity.

RemoveFlags ( IList uids, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Removes a set of flags from the specified messages only if their mod-sequence value is less than the specified value.

Removes a set of flags from the specified messages only if their mod-sequence value is less than the specified value.

RemoveFlags ( IList indexes, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Removes a set of flags from the specified messages only if their mod-sequence value is less than the specified value.

Removes a set of flags from the specified messages only if their mod-sequence value is less than the specified value.

RemoveFlags ( IList uids, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Removes a set of flags from the specified messages.

Removes a set of flags from the specified messages.

RemoveFlags ( IList indexes, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Removes a set of flags from the specified messages.

Removes a set of flags from the specified messages.

RemoveLabels ( IList uids, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Remove a set of labels from the specified messages only if their mod-sequence value is less than the specified value.

Removes a set of labels from the specified messages only if their mod-sequence value is less than the specified value.

RemoveLabels ( IList indexes, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Remove a set of labels from the specified messages only if their mod-sequence value is less than the specified value.

Removes a set of labels from the specified messages only if their mod-sequence value is less than the specified value.

RemoveLabels ( IList uids, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Remove a set of labels from the specified messages.

Removes a set of labels from the specified messages.

RemoveLabels ( IList indexes, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Remove a set of labels from the specified messages.

Removes a set of labels from the specified messages.

Rename ( IMailFolder parent, string name, CancellationToken cancellationToken = default(CancellationToken) ) : void

Renames the folder to exist with a new name under a new parent folder.

Renames the folder to exist with a new name under a new parent folder.

Search ( SearchQuery query, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Searches the folder for messages matching the specified query.

The returned array of unique identifiers can be used with methods such as IMailFolder.GetMessage(UniqueId,CancellationToken,ITransferProgress).

Search ( SearchOptions options, SearchQuery query, CancellationToken cancellationToken = default(CancellationToken) ) : SearchResults

Searches the folder for messages matching the specified query.

Searches the folder for messages matching the specified query, returning only the specified search results.

Search ( string query, CancellationToken cancellationToken = default(CancellationToken) ) : SearchResults

Searches the folder for messages matching the specified query.

Sends a UID SEARCH command with the specified query passed directly to the IMAP server with no interpretation by MailKit. This means that the query may contain any arguments that a UID SEARCH command is allowed to have according to the IMAP specifications and any extensions that are supported, including RETURN parameters.

SearchAsync ( string query, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously searches the folder for messages matching the specified query.

Sends a UID SEARCH command with the specified query passed directly to the IMAP server with no interpretation by MailKit. This means that the query may contain any arguments that a UID SEARCH command is allowed to have according to the IMAP specifications and any extensions that are supported, including RETURN parameters.

SetAccessRights ( string name, AccessRights rights, CancellationToken cancellationToken = default(CancellationToken) ) : void

Set the access rights for the specified identity.

Sets the access rights for the specified identity.

SetFlags ( IList uids, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Sets the flags of the specified messages only if their mod-sequence value is less than the specified value.

Sets the flags of the specified messages only if their mod-sequence value is less than the specified value.

SetFlags ( IList indexes, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Sets the flags of the specified messages only if their mod-sequence value is less than the specified value.

Sets the flags of the specified messages only if their mod-sequence value is less than the specified value.

SetFlags ( IList uids, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Sets the flags of the specified messages.

Sets the flags of the specified messages.

SetFlags ( IList indexes, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Sets the flags of the specified messages.

Sets the flags of the specified messages.

SetLabels ( IList uids, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Set the labels of the specified messages only if their mod-sequence value is less than the specified value.

Sets the labels of the specified messages only if their mod-sequence value is less than the specified value.

SetLabels ( IList indexes, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Set the labels of the specified messages only if their mod-sequence value is less than the specified value.

Sets the labels of the specified messages only if their mod-sequence value is less than the specified value.

SetLabels ( IList uids, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Set the labels of the specified messages.

Sets the labels of the specified messages.

SetLabels ( IList indexes, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void

Sets the labels of the specified messages.

Sets the labels of the specified messages.

SetMetadata ( MetadataCollection metadata, CancellationToken cancellationToken = default(CancellationToken) ) : void

Sets the specified metadata.

Sets the specified metadata.

SetQuota ( uint messageLimit, uint storageLimit, CancellationToken cancellationToken = default(CancellationToken) ) : FolderQuota

Set the quota limits for the folder.

Sets the quota limits for the folder.

To determine if a quotas are supported, check the ImapClient.SupportsQuotas property.

Sort ( SearchQuery query, IList orderBy, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Sort messages matching the specified query.

The returned array of unique identifiers will be sorted in the preferred order and can be used with IMailFolder.GetMessage(UniqueId,CancellationToken,ITransferProgress).

Sort ( SearchOptions options, SearchQuery query, IList orderBy, CancellationToken cancellationToken = default(CancellationToken) ) : SearchResults

Sort messages matching the specified query.

Searches the folder for messages matching the specified query, returning the search results in the specified sort order.

Sort ( string query, CancellationToken cancellationToken = default(CancellationToken) ) : SearchResults

Sort messages matching the specified query.

Sends a UID SORT command with the specified query passed directly to the IMAP server with no interpretation by MailKit. This means that the query may contain any arguments that a UID SORT command is allowed to have according to the IMAP specifications and any extensions that are supported, including RETURN parameters.

SortAsync ( string query, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Asynchronously sort messages matching the specified query.

Sends a UID SORT command with the specified query passed directly to the IMAP server with no interpretation by MailKit. This means that the query may contain any arguments that a UID SORT command is allowed to have according to the IMAP specifications and any extensions that are supported, including RETURN parameters.

Status ( StatusItems items, CancellationToken cancellationToken = default(CancellationToken) ) : void

Updates the values of the specified items.

Updates the values of the specified items.

The Status(StatusItems, System.Threading.CancellationToken) method MUST NOT be used on a folder that is already in the opened state. Instead, other ways of getting the desired information should be used.

For example, a common use for the Status(StatusItems,System.Threading.CancellationToken) method is to get the number of unread messages in the folder. When the folder is open, however, it is possible to use the ImapFolder.Search(MailKit.Search.SearchQuery, System.Threading.CancellationToken) method to query for the list of unread messages.

For more information about the STATUS command, see rfc3501.

Subscribe ( CancellationToken cancellationToken = default(CancellationToken) ) : void

Subscribes the folder.

Subscribes the folder.

Thread ( IList uids, ThreadingAlgorithm algorithm, SearchQuery query, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Threads the messages in the folder that match the search query using the specified threading algorithm.

The MessageThread.UniqueId can be used with methods such as IMailFolder.GetMessage(UniqueId,CancellationToken,ITransferProgress).

Thread ( ThreadingAlgorithm algorithm, SearchQuery query, CancellationToken cancellationToken = default(CancellationToken) ) : IList

Threads the messages in the folder that match the search query using the specified threading algorithm.

The MessageThread.UniqueId can be used with methods such as IMailFolder.GetMessage(UniqueId,CancellationToken,ITransferProgress).

Unsubscribe ( CancellationToken cancellationToken = default(CancellationToken) ) : void

Unsubscribes the folder.

Unsubscribes the folder.

Protected Methods

Method Description
CommitStream ( Stream stream, UniqueId uid ) : Stream

Commit a stream returned by CreateStream.

Commits a stream returned by CreateStream.

This method is called only after both the message data has successfully been written to the stream returned by CreateStream and a UniqueId has been obtained for the associated message.

For subclasses implementing caching, this method should be used for committing the stream to their cache.

Subclass implementations may take advantage of the fact that CommitStream allows returning a new System.IO.Stream reference if they move a file on the file system and wish to return a new System.IO.FileStream based on the new path, for example.
CreateStream ( UniqueId uid, string section, int offset, int length ) : Stream

Create a backing stream for use with the GetMessage, GetBodyPart, and GetStream methods.

Allows subclass implementations to override the type of stream created for use with the GetMessage, GetBodyPart and GetStream methods.

This could be useful for subclass implementations that intend to implement support for caching and/or for subclass implementations that want to use temporary file streams instead of memory-based streams for larger amounts of message data.

Subclasses that implement caching using this API should wait for CommitStream before adding the stream to their cache.

Streams returned by this method SHOULD clean up any allocated resources such as deleting temporary files from the file system.

The uid will not be available for the various GetMessage(), GetBodyPart() and GetStream() methods that take a message index rather than a UniqueId. It may also not be available if the IMAP server response does not specify the UID value prior to sending the literal-string token containing the message stream.
OnParentFolderRenamed ( ) : void

Notifies the folder that a parent folder has been renamed.

Updates the MailFolder.FullName property.

Private Methods

Method Description
AsReadOnly ( ICollection collection ) : IList
BuildQueryExpression ( SearchQuery query, List args, string &charset ) : string
BuildSortOrder ( IList orderBy ) : string
ESearchMatches ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
FormatDateTime ( System.DateTime date ) : string
FormatSummaryItems ( MessageSummaryItems &items, HashSet fields ) : string
GetBodyPartQuery ( string partSpec, bool headersOnly, string &tags ) : string
GetFetchRange ( int min, int max ) : string
GetHeaderNames ( HashSet fields ) : HashSet
IsAscii ( string text ) : bool
LabelListToString ( IList labels, ICollection args ) : string
ModifyFlags ( IList uids, ulong modseq, MessageFlags flags, HashSet userFlags, string action, CancellationToken cancellationToken ) : IList
ModifyFlags ( IList indexes, ulong modseq, MessageFlags flags, HashSet userFlags, string action, CancellationToken cancellationToken ) : IList
ModifyLabels ( IList uids, ulong modseq, IList labels, string action, CancellationToken cancellationToken ) : IList
ModifyLabels ( IList indexes, ulong modseq, IList labels, string action, CancellationToken cancellationToken ) : IList
OnExists ( int count ) : void
OnExpunge ( int index ) : void
OnFetch ( MailKit.Net.Imap.ImapEngine engine, int index, CancellationToken cancellationToken ) : void
OnRecent ( int count ) : void
OnVanished ( MailKit.Net.Imap.ImapEngine engine, CancellationToken cancellationToken ) : void
ParseEntity ( Stream stream, bool dispose, CancellationToken cancellationToken ) : MimeKit.MimeEntity
ParseMessage ( Stream stream, CancellationToken cancellationToken ) : MimeMessage
QResyncFetch ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
QueueAppend ( MimeKit.FormatOptions options, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken, ITransferProgress progress ) : ImapCommand
QueueMultiAppend ( MimeKit.FormatOptions options, IList messages, IList flags, IList dates, CancellationToken cancellationToken, ITransferProgress progress ) : ImapCommand
ReadLiteralData ( MailKit.Net.Imap.ImapEngine engine, CancellationToken cancellationToken ) : void
ReadStringToken ( MailKit.Net.Imap.ImapEngine engine, string format, CancellationToken cancellationToken ) : string
SearchMatches ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
SelectOrExamine ( FolderAccess access ) : string
ThreadMatches ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
UntaggedAcl ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
UntaggedListRights ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
UntaggedMyRights ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
UntaggedQuota ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
UntaggedQuotaRoot ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
UpdateAcceptedFlags ( MessageFlags flags ) : void
UpdateAppendLimit ( uint limit ) : void
UpdateAttributes ( FolderAttributes attrs ) : void
UpdateHighestModSeq ( ulong modseq ) : void
UpdateIsNamespace ( bool value ) : void
UpdatePermanentFlags ( MessageFlags flags ) : void
UpdateUidNext ( UniqueId uid ) : void
UpdateUidValidity ( uint validity ) : void
UpdateUnread ( int count ) : void

Method Details

AddAccessRights() public method

Add access rights for the specified identity.
Adds the given access rights for the specified identity.
/// is null. /// -or- /// is null. /// /// No rights were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the ACL extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public AddAccessRights ( string name, AccessRights rights, CancellationToken cancellationToken = default(CancellationToken) ) : void
name string The identity name.
rights AccessRights The access rights.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

AddFlags() public method

Adds a set of flags to the specified messages only if their mod-sequence value is less than the specified value.
Adds a set of flags to the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// /// One or more of the is invalid. /// -or- /// No flags were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public AddFlags ( IList uids, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs of the messages.
modseq ulong The mod-sequence value.
flags MessageFlags The message flags to add.
userFlags HashSet A set of user-defined flags to add.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

AddFlags() public method

Adds a set of flags to the specified messages only if their mod-sequence value is less than the specified value.
Adds a set of flags to the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// /// One or more of the is invalid. /// -or- /// No flags were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public AddFlags ( IList indexes, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes of the messages.
modseq ulong The mod-sequence value.
flags MessageFlags The message flags to add.
userFlags HashSet A set of user-defined flags to add.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

AddFlags() public method

Adds a set of flags to the specified messages.
Adds a set of flags to the specified messages.
/// is null. /// /// One or more of the is invalid. /// -or- /// No flags were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public AddFlags ( IList uids, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
uids IList The UIDs of the messages.
flags MessageFlags The message flags to add.
userFlags HashSet A set of user-defined flags to add.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

AddFlags() public method

Adds a set of flags to the specified messages.
Adds a set of flags to the specified messages.
/// is null. /// /// One or more of the is invalid. /// -or- /// No flags were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public AddFlags ( IList indexes, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
indexes IList The indexes of the messages.
flags MessageFlags The message flags to add.
userFlags HashSet A set of user-defined flags to add.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

AddLabels() public method

Add a set of labels to the specified messages only if their mod-sequence value is less than the specified value.
Adds a set of labels to the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// No labels were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public AddLabels ( IList uids, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs of the messages.
modseq ulong The mod-sequence value.
labels IList The labels to add.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

AddLabels() public method

Add a set of labels to the specified messages only if their mod-sequence value is less than the specified value.
Adds a set of labels to the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// No labels were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public AddLabels ( IList indexes, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes of the messages.
modseq ulong The mod-sequence value.
labels IList The labels to add.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

AddLabels() public method

Add a set of labels to the specified messages.
Adds a set of labels to the specified messages.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// No labels were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public AddLabels ( IList uids, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
uids IList The UIDs of the messages.
labels IList The labels to add.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

AddLabels() public method

Add a set of labels to the specified messages.
Adds a set of labels to the specified messages.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// No labels were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public AddLabels ( IList indexes, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
indexes IList The indexes of the messages.
labels IList The labels to add.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

Append() public method

Appends the specified messages to the folder.
Appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
/// is null. /// -or- /// is null. /// -or- /// is null. /// /// One or more of the is null. /// -or- /// The number of messages does not match the number of flags. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// Internationalized formatting was requested but has not been enabled. /// /// The does not exist. /// /// The operation was canceled via the cancellation token. /// /// Internationalized formatting was requested but is not supported by the server. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Append ( MimeKit.FormatOptions options, IList messages, IList flags, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList
options MimeKit.FormatOptions The formatting options.
messages IList The list of messages to append to the folder.
flags IList The message flags to use for each message.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return IList

Append() public method

Appends the specified messages to the folder.
Appends the specified messages to the folder and returns the UniqueIds assigned to the messages.
/// is null. /// -or- /// is null. /// -or- /// is null. /// -or- /// is null. /// /// One or more of the is null. /// -or- /// The number of messages, flags, and dates do not match. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// Internationalized formatting was requested but has not been enabled. /// /// The does not exist. /// /// The operation was canceled via the cancellation token. /// /// Internationalized formatting was requested but is not supported by the server. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Append ( MimeKit.FormatOptions options, IList messages, IList flags, IList dates, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : IList
options MimeKit.FormatOptions The formatting options.
messages IList The list of messages to append to the folder.
flags IList The message flags to use for each of the messages.
dates IList The received dates to use for each of the messages.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return IList

Append() public method

Appends the specified message to the folder.
Appends the specified message to the folder and returns the UniqueId assigned to the message.
/// is null. /// -or- /// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// Internationalized formatting was requested but has not been enabled. /// /// The does not exist. /// /// The operation was canceled via the cancellation token. /// /// Internationalized formatting was requested but is not supported by the server. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Append ( MimeKit.FormatOptions options, MimeMessage message, MessageFlags flags = MessageFlags.None, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : UniqueId?
options MimeKit.FormatOptions The formatting options.
message MimeKit.MimeMessage The message.
flags MessageFlags The message flags.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return UniqueId?

Append() public method

Appends the specified message to the folder.
Appends the specified message to the folder and returns the UniqueId assigned to the message.
/// is null. /// -or- /// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// Internationalized formatting was requested but has not been enabled. /// /// The does not exist. /// /// The operation was canceled via the cancellation token. /// /// Internationalized formatting was requested but is not supported by the server. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Append ( MimeKit.FormatOptions options, MimeMessage message, MessageFlags flags, DateTimeOffset date, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : UniqueId?
options MimeKit.FormatOptions The formatting options.
message MimeKit.MimeMessage The message.
flags MessageFlags The message flags.
date DateTimeOffset The received date of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return UniqueId?

BuildQuery() public method

public BuildQuery ( StringBuilder builder, SearchQuery query, List args, bool parens, bool &ascii ) : void
builder StringBuilder
query MailKit.Search.SearchQuery
args List
parens bool
ascii bool
return void

Check() public method

Force the server to sync its in-memory state with its disk state.

The CHECK command forces the IMAP server to sync its in-memory state with its disk state.

For more information about the CHECK command, see rfc350101.

/// The has been disposed. /// /// The is not currently open. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Check ( CancellationToken cancellationToken = default(CancellationToken) ) : void
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

CheckState() public method

public CheckState ( bool open, bool rw ) : void
open bool
rw bool
return void

Close() public method

Closes the folder, optionally expunging the messages marked for deletion.
Closes the folder, optionally expunging the messages marked for deletion.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Close ( bool expunge = false, CancellationToken cancellationToken = default(CancellationToken) ) : void
expunge bool If set to true, expunge.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

CommitStream() protected method

Commit a stream returned by CreateStream.

Commits a stream returned by CreateStream.

This method is called only after both the message data has successfully been written to the stream returned by CreateStream and a UniqueId has been obtained for the associated message.

For subclasses implementing caching, this method should be used for committing the stream to their cache.

Subclass implementations may take advantage of the fact that CommitStream allows returning a new System.IO.Stream reference if they move a file on the file system and wish to return a new System.IO.FileStream based on the new path, for example.
protected CommitStream ( Stream stream, UniqueId uid ) : Stream
stream Stream The stream.
uid UniqueId The unique identifier of the message.
return Stream

CopyTo() public method

Copies the specified messages to the destination folder.
Copies the specified messages to the destination folder.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// The destination folder does not belong to the . /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// does not exist. /// /// The is not currently open. /// /// The IMAP server does not support the UIDPLUS extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public CopyTo ( IList uids, IMailFolder destination, CancellationToken cancellationToken = default(CancellationToken) ) : UniqueIdMap
uids IList The UIDs of the messages to copy.
destination IMailFolder The destination folder.
cancellationToken System.Threading.CancellationToken The cancellation token.
return UniqueIdMap

CopyTo() public method

Copies the specified messages to the destination folder.
Copies the specified messages to the destination folder.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// The destination folder does not belong to the . /// /// The has been disposed. /// /// The is not currently open. /// /// The is not connected. /// /// The is not authenticated. /// /// does not exist. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public CopyTo ( IList indexes, IMailFolder destination, CancellationToken cancellationToken = default(CancellationToken) ) : void
indexes IList The indexes of the messages to copy.
destination IMailFolder The destination folder.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

Create() public method

Creates a new subfolder with the given name.
Creates a new subfolder with the given name.
/// is null. /// -or- /// is null. /// /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is nil, and thus child folders cannot be created. /// /// The IMAP server does not support the CREATE-SPECIAL-USE extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Create ( string name, IEnumerable specialUses, CancellationToken cancellationToken = default(CancellationToken) ) : IMailFolder
name string The name of the folder to create.
specialUses IEnumerable A list of special uses for the folder being created.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IMailFolder

Create() public method

Creates a new subfolder with the given name.
Creates a new subfolder with the given name.
/// is null. /// /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is nil, and thus child folders cannot be created. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Create ( string name, bool isMessageFolder, CancellationToken cancellationToken = default(CancellationToken) ) : IMailFolder
name string The name of the folder to create.
isMessageFolder bool true if the folder will be used to contain messages; otherwise false.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IMailFolder

CreateStream() protected method

Create a backing stream for use with the GetMessage, GetBodyPart, and GetStream methods.

Allows subclass implementations to override the type of stream created for use with the GetMessage, GetBodyPart and GetStream methods.

This could be useful for subclass implementations that intend to implement support for caching and/or for subclass implementations that want to use temporary file streams instead of memory-based streams for larger amounts of message data.

Subclasses that implement caching using this API should wait for CommitStream before adding the stream to their cache.

Streams returned by this method SHOULD clean up any allocated resources such as deleting temporary files from the file system.

The uid will not be available for the various GetMessage(), GetBodyPart() and GetStream() methods that take a message index rather than a UniqueId. It may also not be available if the IMAP server response does not specify the UID value prior to sending the literal-string token containing the message stream.
protected CreateStream ( UniqueId uid, string section, int offset, int length ) : Stream
uid UniqueId The unique identifier of the message, if available.
section string The section of the message that is being fetched.
offset int The starting offset of the message section being fetched.
length int The length of the stream being fetched, measured in bytes.
return Stream

Delete() public method

Deletes the folder on the IMAP server.

Deletes the folder on the IMAP server.

This method will not delete any child folders.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The folder cannot be deleted (it is either a namespace or the Inbox). /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Delete ( CancellationToken cancellationToken = default(CancellationToken) ) : void
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

Expunge() public method

Expunges the folder, permanently removing all messages marked for deletion.

The EXPUNGE command permanently removes all messages in the folder that have the MessageFlags.Deleted flag set.

For more information about the EXPUNGE command, see rfc3501.

Normally, a MailFolder.MessageExpunged event will be emitted for each message that is expunged. However, if the IMAP server supports the QRESYNC extension and it has been enabled via the ImapClient.EnableQuickResync(CancellationToken) method, then the MailFolder.MessagesVanished event will be emitted rather than the MailFolder.MessageExpunged event.
/// The has been disposed. /// /// The is not currently open in read-write mode. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Expunge ( CancellationToken cancellationToken = default(CancellationToken) ) : void
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

Expunge() public method

Expunge the specified uids, permanently removing them from the folder.

Expunges the specified uids, permanently removing them from the folder.

If the IMAP server supports the UIDPLUS extension (check the ImapClient.Capabilities for the ImapCapabilities.UidPlus flag), then this operation is atomic. Otherwise, MailKit implements this operation by first searching for the full list of message uids in the folder that are marked for deletion, unmarking the set of message uids that are not within the specified list of uids to be be expunged, expunging the folder (thus expunging the requested uids), and finally restoring the deleted flag on the collection of message uids that were originally marked for deletion that were not included in the list of uids provided. For this reason, it is advisable for clients that wish to maintain state to implement this themselves when the IMAP server does not support the UIDPLUS extension.

For more information about the UID EXPUNGE command, see rfc4315.

Normally, a MailFolder.MessageExpunged event will be emitted for each message that is expunged. However, if the IMAP server supports the QRESYNC extension and it has been enabled via the ImapClient.EnableQuickResync(CancellationToken) method, then the MailFolder.MessagesVanished event will be emitted rather than the MailFolder.MessageExpunged event.
/// is null. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Expunge ( IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : void
uids IList The message uids.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

Fetch() public method

Fetches the message summaries for the specified message UIDs.

Fetches the message summaries for the specified message UIDs.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// /// is empty. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not currently open. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList uids, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs.
items MessageSummaryItems The message summary items to fetch.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message UIDs.

Fetches the message summaries for the specified message UIDs.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList uids, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message UIDs.

Fetches the message summaries for the specified message UIDs.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList uids, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

If the IMAP server supports the QRESYNC extension and the application has enabled this feature via ImapClient.EnableQuickResync(CancellationToken), then this method will emit MailFolder.MessagesVanished events for messages that have vanished since the specified mod-sequence value.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// /// is empty. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList uids, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs.
modseq ulong The mod-sequence value.
items MessageSummaryItems The message summary items to fetch.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

If the IMAP server supports the QRESYNC extension and the application has enabled this feature via ImapClient.EnableQuickResync(CancellationToken), then this method will emit MailFolder.MessagesVanished events for messages that have vanished since the specified mod-sequence value.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList uids, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs.
modseq ulong The mod-sequence value.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message UIDs that have a higher mod-sequence value than the one specified.

If the IMAP server supports the QRESYNC extension and the application has enabled this feature via ImapClient.EnableQuickResync(CancellationToken), then this method will emit MailFolder.MessagesVanished events for messages that have vanished since the specified mod-sequence value.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList uids, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs.
modseq ulong The mod-sequence value.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message indexes.

Fetches the message summaries for the specified message indexes.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// /// is empty. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList indexes, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes.
items MessageSummaryItems The message summary items to fetch.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message indexes.

Fetches the message summaries for the specified message indexes.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList indexes, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message indexes.

Fetches the message summaries for the specified message indexes.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList indexes, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// /// is empty. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList indexes, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes.
modseq ulong The mod-sequence value.
items MessageSummaryItems The message summary items to fetch.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList indexes, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes.
modseq ulong The mod-sequence value.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the specified message indexes that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( IList indexes, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes.
modseq ulong The mod-sequence value.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the messages between the two indexes, inclusive.

Fetches the message summaries for the messages between the two indexes, inclusive.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is out of range. /// -or- /// is out of range. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( int min, int max, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList
min int The minimum index.
max int The maximum index, or -1 to specify no upper bound.
items MessageSummaryItems The message summary items to fetch.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the messages between the two indexes, inclusive.

Fetches the message summaries for the messages between the two indexes, inclusive.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is out of range. /// -or- /// is out of range. /// /// is null. /// /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( int min, int max, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
min int The minimum index.
max int The maximum index, or -1 to specify no upper bound.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the messages between the two indexes, inclusive.

Fetches the message summaries for the messages between the two indexes, inclusive.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is out of range. /// -or- /// is out of range. /// /// is null. /// /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( int min, int max, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
min int The minimum index.
max int The maximum index, or -1 to specify no upper bound.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is out of range. /// -or- /// is out of range. /// -or- /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( int min, int max, ulong modseq, MessageSummaryItems items, CancellationToken cancellationToken = default(CancellationToken) ) : IList
min int The minimum index.
max int The maximum index, or -1 to specify no upper bound.
modseq ulong The mod-sequence value.
items MessageSummaryItems The message summary items to fetch.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is out of range. /// -or- /// is out of range. /// /// is null. /// /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( int min, int max, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
min int The minimum index.
max int The maximum index, or -1 to specify no upper bound.
modseq ulong The mod-sequence value.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Fetch() public method

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

Fetches the message summaries for the messages between the two indexes (inclusive) that have a higher mod-sequence value than the one specified.

It should be noted that if another client has modified any message in the folder, the IMAP server may choose to return information that was not explicitly requested. It is therefore important to be prepared to handle both additional fields on a IMessageSummary for messages that were requested as well as summaries for messages that were not requested at all.

/// is out of range. /// -or- /// is out of range. /// /// is null. /// /// is empty. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Fetch ( int min, int max, ulong modseq, MessageSummaryItems items, HashSet fields, CancellationToken cancellationToken = default(CancellationToken) ) : IList
min int The minimum index.
max int The maximum index, or -1 to specify no upper bound.
modseq ulong The mod-sequence value.
items MessageSummaryItems The message summary items to fetch.
fields HashSet The desired header fields.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

FetchStream() public method

public FetchStream ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
engine MailKit.Net.Imap.ImapEngine
ic ImapCommand
index int
return void

FetchSummaryItems() public method

public FetchSummaryItems ( MailKit.Net.Imap.ImapEngine engine, ImapCommand ic, int index ) : void
engine MailKit.Net.Imap.ImapEngine
ic ImapCommand
index int
return void

GetAccessControlList() public method

Get the complete access control list for the folder.
Gets the complete access control list for the folder.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the ACL extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public GetAccessControlList ( CancellationToken cancellationToken = default(CancellationToken) ) : AccessControlList
cancellationToken System.Threading.CancellationToken The cancellation token.
return AccessControlList

GetAccessRights() public method

Get the access rights for a particular identifier.
Gets the access rights for a particular identifier.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the ACL extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public GetAccessRights ( string name, CancellationToken cancellationToken = default(CancellationToken) ) : AccessRights
name string The identifier name.
cancellationToken System.Threading.CancellationToken The cancellation token.
return AccessRights

GetBodyPart() public method

Gets the specified body part.
Gets the specified body part.
/// is null. /// /// is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message body. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetBodyPart ( UniqueId uid, BodyPart part, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity
uid UniqueId The UID of the message.
part BodyPart The body part.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeEntity

GetBodyPart() public method

Gets the specified body part.
Gets the specified body part.
/// is null. /// /// is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message body. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetBodyPart ( UniqueId uid, BodyPart part, bool headersOnly, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity
uid UniqueId The UID of the message.
part BodyPart The body part.
headersOnly bool true if only the headers should be downloaded; otherwise, false>
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeEntity

GetBodyPart() public method

Gets the specified body part.
Gets the specified body part.
/// is null. /// /// is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message body. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetBodyPart ( UniqueId uid, string partSpecifier, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity
uid UniqueId The UID of the message.
partSpecifier string The body part specifier.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeEntity

GetBodyPart() public method

Gets the specified body part.
Gets the specified body part.
/// is null. /// /// is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message body. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetBodyPart ( UniqueId uid, string partSpecifier, bool headersOnly, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity
uid UniqueId The UID of the message.
partSpecifier string The body part specifier.
headersOnly bool true if only the headers should be downloaded; otherwise, false>
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeEntity

GetBodyPart() public method

Gets the specified body part.
Gets the specified body part.
/// is null. /// /// is out of range. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetBodyPart ( int index, BodyPart part, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity
index int The index of the message.
part BodyPart The body part.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeEntity

GetBodyPart() public method

Gets the specified body part.
Gets the specified body part.
/// is null. /// /// is out of range. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetBodyPart ( int index, BodyPart part, bool headersOnly, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity
index int The index of the message.
part BodyPart The body part.
headersOnly bool true if only the headers should be downloaded; otherwise, false>
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeEntity

GetBodyPart() public method

Gets the specified body part.
Gets the specified body part.
/// is null. /// /// is out of range. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetBodyPart ( int index, string partSpecifier, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity
index int The index of the message.
partSpecifier string The body part specifier.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeEntity

GetBodyPart() public method

Gets the specified body part.
Gets the specified body part.
/// is null. /// /// is out of range. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetBodyPart ( int index, string partSpecifier, bool headersOnly, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeKit.MimeEntity
index int The index of the message.
partSpecifier string The body part specifier.
headersOnly bool true if only the headers should be downloaded; otherwise, false>
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeEntity

GetEnumerator() public method

Gets an enumerator for the messages in the folder.
Gets an enumerator for the messages in the folder.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. ///
public GetEnumerator ( ) : IEnumerator
return IEnumerator

GetMessage() public method

Gets the specified message.
Gets the specified message.
/// is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetMessage ( UniqueId uid, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeMessage
uid UniqueId The UID of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeMessage

GetMessage() public method

Gets the specified message.
Gets the specified message.
/// is out of range. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetMessage ( int index, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : MimeMessage
index int The index of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return MimeKit.MimeMessage

GetMetadata() public method

Gets the specified metadata.
Gets the specified metadata.
/// is null. /// -or- /// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the METADATA extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetMetadata ( MetadataOptions options, IEnumerable tags, CancellationToken cancellationToken = default(CancellationToken) ) : MetadataCollection
options MetadataOptions The metadata options.
tags IEnumerable The metadata tags.
cancellationToken System.Threading.CancellationToken The cancellation token.
return MetadataCollection

GetMetadata() public method

Gets the specified metadata.
Gets the specified metadata.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the METADATA extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetMetadata ( MetadataTag tag, CancellationToken cancellationToken = default(CancellationToken) ) : string
tag MetadataTag The metadata tag.
cancellationToken System.Threading.CancellationToken The cancellation token.
return string

GetMyAccessRights() public method

Get the access rights for the current authenticated user.
Gets the access rights for the current authenticated user.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the ACL extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public GetMyAccessRights ( CancellationToken cancellationToken = default(CancellationToken) ) : AccessRights
cancellationToken System.Threading.CancellationToken The cancellation token.
return AccessRights

GetQuota() public method

Get the quota information for the folder.

Gets the quota information for the folder.

To determine if a quotas are supported, check the ImapClient.SupportsQuotas property.

/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the QUOTA extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetQuota ( CancellationToken cancellationToken = default(CancellationToken) ) : FolderQuota
cancellationToken System.Threading.CancellationToken The cancellation token.
return FolderQuota

GetStream() public method

Gets a substream of the specified message.
Fetches a substream of the message. If the starting offset is beyond the end of the message, an empty stream is returned. If the number of bytes desired extends beyond the end of the message, a truncated stream will be returned.
/// is invalid. /// /// is negative. /// -or- /// is negative. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message stream. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetStream ( UniqueId uid, int offset, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream
uid UniqueId The UID of the message.
offset int The starting offset of the first desired byte.
count int The number of bytes desired.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Stream

GetStream() public method

Gets a substream of the specified body part.

Gets a substream of the specified message.

For more information about how to construct the section, see Section 6.4.5 of RFC3501.

/// is invalid. /// /// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message stream. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetStream ( UniqueId uid, string section, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream
uid UniqueId The UID of the message.
section string The desired section of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Stream

GetStream() public method

Gets a substream of the specified message.

Gets a substream of the specified message. If the starting offset is beyond the end of the specified section of the message, an empty stream is returned. If the number of bytes desired extends beyond the end of the section, a truncated stream will be returned.

For more information about how to construct the section, see Section 6.4.5 of RFC3501.

/// is invalid. /// /// is null. /// /// is negative. /// -or- /// is negative. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message stream. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetStream ( UniqueId uid, string section, int offset, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream
uid UniqueId The UID of the message.
section string The desired section of the message.
offset int The starting offset of the first desired byte.
count int The number of bytes desired.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Stream

GetStream() public method

Gets a substream of the specified message.
Fetches a substream of the message. If the starting offset is beyond the end of the message, an empty stream is returned. If the number of bytes desired extends beyond the end of the message, a truncated stream will be returned.
/// is out of range. /// -or- /// is negative. /// -or- /// is negative. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message stream. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetStream ( int index, int offset, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream
index int The index of the message.
offset int The starting offset of the first desired byte.
count int The number of bytes desired.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Stream

GetStream() public method

Gets a substream of the specified message.

Gets a substream of the specified message.

For more information about how to construct the section, see Section 6.4.5 of RFC3501.

/// is null. /// /// is out of range. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message stream. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetStream ( int index, string section, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream
index int The index of the message.
section string The desired section of the message.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Stream

GetStream() public method

Gets a substream of the specified message.

Gets a substream of the specified message. If the starting offset is beyond the end of the specified section of the message, an empty stream is returned. If the number of bytes desired extends beyond the end of the section, a truncated stream will be returned.

For more information about how to construct the section, see Section 6.4.5 of RFC3501.

/// is null. /// /// is out of range. /// -or- /// is negative. /// -or- /// is negative. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The IMAP server did not return the requested message stream. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetStream ( int index, string section, int offset, int count, CancellationToken cancellationToken = default(CancellationToken), ITransferProgress progress = null ) : Stream
index int The index of the message.
section string The desired section of the message.
offset int The starting offset of the first desired byte.
count int The number of bytes desired.
cancellationToken System.Threading.CancellationToken The cancellation token.
progress ITransferProgress The progress reporting mechanism.
return Stream

GetSubfolder() public method

Gets the specified subfolder.
Gets the specified subfolder.
/// is null. /// /// is either an empty string or contains the . /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The requested folder could not be found. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetSubfolder ( string name, CancellationToken cancellationToken = default(CancellationToken) ) : IMailFolder
name string The name of the subfolder.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IMailFolder

GetSubfolders() public method

Gets the subfolders.
Gets the subfolders.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public GetSubfolders ( StatusItems items, bool subscribedOnly = false, CancellationToken cancellationToken = default(CancellationToken) ) : IEnumerable
items StatusItems The status items to pre-populate.
subscribedOnly bool If set to true, only subscribed folders will be listed.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IEnumerable

ImapFolder() public method

Initializes a new instance of the MailKit.Net.Imap.ImapFolder class.

Creates a new ImapFolder.

If you subclass ImapFolder, you will also need to subclass ImapClient and override the ImapClient.CreateImapFolder(ImapFolderConstructorArgs) method in order to return a new instance of your ImapFolder subclass.

/// is null. ///
public ImapFolder ( MailKit.Net.Imap.ImapFolderConstructorArgs args ) : System
args MailKit.Net.Imap.ImapFolderConstructorArgs The constructor arguments.
return System

ModifyAccessRights() public method

public ModifyAccessRights ( string name, AccessRights rights, string action, CancellationToken cancellationToken ) : void
name string
rights AccessRights
action string
cancellationToken System.Threading.CancellationToken
return void

MoveTo() public method

Move the specified messages to the destination folder.

Moves the specified messages to the destination folder.

If the IMAP server supports the MOVE extension (check the ImapClient.Capabilities property for the ImapCapabilities.Move flag), then this operation will be atomic. Otherwise, MailKit implements this by first copying the messages to the destination folder, then marking them for deletion in the originating folder, and finally expunging them (see Expunge(IList<UniqueId>,CancellationToken) for more information about how a subset of messages are expunged). Since the server could disconnect at any point between those 3 (or more) commands, it is advisable for clients to implement their own logic for moving messages when the IMAP server does not support the MOVE command in order to better handle spontanious server disconnects and other error conditions.

/// is null. /// -or- /// is null. /// /// is empty. /// -or- /// One or more of the is invalid. /// -or- /// The destination folder does not belong to the . /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// does not exist. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public MoveTo ( IList uids, IMailFolder destination, CancellationToken cancellationToken = default(CancellationToken) ) : UniqueIdMap
uids IList The UIDs of the messages to move.
destination IMailFolder The destination folder.
cancellationToken System.Threading.CancellationToken The cancellation token.
return UniqueIdMap

MoveTo() public method

Moves the specified messages to the destination folder.

If the IMAP server supports the MOVE command, then the MOVE command will be used. Otherwise, the messages will first be copied to the destination folder and then marked as \Deleted in the originating folder. Since the server could disconnect at any point between those 2 operations, it may be advisable to implement your own logic for moving messages in this case in order to better handle spontanious server disconnects and other error conditions.

/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// The destination folder does not belong to the . /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// does not exist. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public MoveTo ( IList indexes, IMailFolder destination, CancellationToken cancellationToken = default(CancellationToken) ) : void
indexes IList The indexes of the messages to move.
destination IMailFolder The destination folder.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

OnParentFolderRenamed() protected method

Notifies the folder that a parent folder has been renamed.
Updates the MailFolder.FullName property.
protected OnParentFolderRenamed ( ) : void
return void

Open() public method

Opens the folder using the requested folder access.
Opens the folder using the requested folder access.
/// is not a valid value. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The does not exist. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Open ( FolderAccess access, CancellationToken cancellationToken = default(CancellationToken) ) : FolderAccess
access FolderAccess The requested folder access.
cancellationToken System.Threading.CancellationToken The cancellation token.
return FolderAccess

Open() public method

Opens the folder using the requested folder access.

This variant of the Open(FolderAccess,System.Threading.CancellationToken) method is meant for quick resynchronization of the folder. Before calling this method, the ImapClient.EnableQuickResync(CancellationToken) method MUST be called.

You should also make sure to add listeners to the MailFolder.MessagesVanished and MailFolder.MessageFlagsChanged events to get notifications of changes since the last time the folder was opened.

/// is not a valid value. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The does not exist. /// /// The QRESYNC feature has not been enabled. /// /// The IMAP server does not support the QRESYNC extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Open ( FolderAccess access, uint uidValidity, ulong highestModSeq, IList uids, CancellationToken cancellationToken = default(CancellationToken) ) : FolderAccess
access FolderAccess The requested folder access.
uidValidity uint The last known value.
highestModSeq ulong The last known value.
uids IList The last known list of unique message identifiers.
cancellationToken System.Threading.CancellationToken The cancellation token.
return FolderAccess

ProcessResponseCodes() public method

public ProcessResponseCodes ( ImapCommand ic, IMailFolder folder ) : void
ic ImapCommand
folder IMailFolder
return void

RemoveAccess() public method

Remove all access rights for the given identity.
Removes all access rights for the given identity.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the ACL extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public RemoveAccess ( string name, CancellationToken cancellationToken = default(CancellationToken) ) : void
name string The identity name.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

RemoveAccessRights() public method

Remove access rights for the specified identity.
Removes the given access rights for the specified identity.
/// is null. /// -or- /// is null. /// /// No rights were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the ACL extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public RemoveAccessRights ( string name, AccessRights rights, CancellationToken cancellationToken = default(CancellationToken) ) : void
name string The identity name.
rights AccessRights The access rights.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

RemoveFlags() public method

Removes a set of flags from the specified messages only if their mod-sequence value is less than the specified value.
Removes a set of flags from the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// /// One or more of the is invalid. /// -or- /// No flags were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public RemoveFlags ( IList uids, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs of the messages.
modseq ulong The mod-sequence value.
flags MessageFlags The message flags to remove.
userFlags HashSet A set of user-defined flags to remove.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

RemoveFlags() public method

Removes a set of flags from the specified messages only if their mod-sequence value is less than the specified value.
Removes a set of flags from the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// /// One or more of the is invalid. /// -or- /// No flags were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public RemoveFlags ( IList indexes, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes of the messages.
modseq ulong The mod-sequence value.
flags MessageFlags The message flags to remove.
userFlags HashSet A set of user-defined flags to remove.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

RemoveFlags() public method

Removes a set of flags from the specified messages.
Removes a set of flags from the specified messages.
/// is null. /// /// One or more of the is invalid. /// -or- /// No flags were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public RemoveFlags ( IList uids, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
uids IList The UIDs of the messages.
flags MessageFlags The message flags to remove.
userFlags HashSet A set of user-defined flags to remove.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

RemoveFlags() public method

Removes a set of flags from the specified messages.
Removes a set of flags from the specified messages.
/// is null. /// /// One or more of the is invalid. /// -or- /// No flags were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public RemoveFlags ( IList indexes, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
indexes IList The indexes of the messages.
flags MessageFlags The message flags to remove.
userFlags HashSet A set of user-defined flags to remove.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

RemoveLabels() public method

Remove a set of labels from the specified messages only if their mod-sequence value is less than the specified value.
Removes a set of labels from the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// No labels were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public RemoveLabels ( IList uids, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs of the messages.
modseq ulong The mod-sequence value.
labels IList The labels to remove.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

RemoveLabels() public method

Remove a set of labels from the specified messages only if their mod-sequence value is less than the specified value.
Removes a set of labels from the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// No labels were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public RemoveLabels ( IList indexes, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes of the messages.
modseq ulong The mod-sequence value.
labels IList The labels to remove.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

RemoveLabels() public method

Remove a set of labels from the specified messages.
Removes a set of labels from the specified messages.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// No labels were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public RemoveLabels ( IList uids, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
uids IList The UIDs of the messages.
labels IList The labels to remove.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

RemoveLabels() public method

Remove a set of labels from the specified messages.
Removes a set of labels from the specified messages.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// -or- /// No labels were specified. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public RemoveLabels ( IList indexes, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
indexes IList The indexes of the messages.
labels IList The labels to remove.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

Rename() public method

Renames the folder to exist with a new name under a new parent folder.
Renames the folder to exist with a new name under a new parent folder.
/// is null. /// -or- /// is null. /// /// does not belong to the . /// -or- /// is not a legal folder name. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The does not exist. /// /// The folder cannot be renamed (it is either a namespace or the Inbox). /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Rename ( IMailFolder parent, string name, CancellationToken cancellationToken = default(CancellationToken) ) : void
parent IMailFolder The new parent folder.
name string The new name of the folder.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

Search() public method

Searches the folder for messages matching the specified query.
The returned array of unique identifiers can be used with methods such as IMailFolder.GetMessage(UniqueId,CancellationToken,ITransferProgress).
/// is null. /// /// One or more search terms in the are not supported by the IMAP server. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Search ( SearchQuery query, CancellationToken cancellationToken = default(CancellationToken) ) : IList
query MailKit.Search.SearchQuery The search query.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Search() public method

Searches the folder for messages matching the specified query.
Searches the folder for messages matching the specified query, returning only the specified search results.
/// is null. /// /// One or more search terms in the are not supported by the IMAP server. /// -or- /// The IMAP server does not support the ESEARCH extension. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Search ( SearchOptions options, SearchQuery query, CancellationToken cancellationToken = default(CancellationToken) ) : SearchResults
options SearchOptions The search options.
query MailKit.Search.SearchQuery The search query.
cancellationToken System.Threading.CancellationToken The cancellation token.
return MailKit.Search.SearchResults

Search() public method

Searches the folder for messages matching the specified query.
Sends a UID SEARCH command with the specified query passed directly to the IMAP server with no interpretation by MailKit. This means that the query may contain any arguments that a UID SEARCH command is allowed to have according to the IMAP specifications and any extensions that are supported, including RETURN parameters.
/// is null. /// /// is an empty string. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Search ( string query, CancellationToken cancellationToken = default(CancellationToken) ) : SearchResults
query string The search query.
cancellationToken System.Threading.CancellationToken The cancellation token.
return MailKit.Search.SearchResults

SearchAsync() public method

Asynchronously searches the folder for messages matching the specified query.
Sends a UID SEARCH command with the specified query passed directly to the IMAP server with no interpretation by MailKit. This means that the query may contain any arguments that a UID SEARCH command is allowed to have according to the IMAP specifications and any extensions that are supported, including RETURN parameters.
/// is null. /// /// is an empty string. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SearchAsync ( string query, CancellationToken cancellationToken = default(CancellationToken) ) : Task
query string The search query.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

SetAccessRights() public method

Set the access rights for the specified identity.
Sets the access rights for the specified identity.
/// is null. /// -or- /// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the ACL extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The command failed. ///
public SetAccessRights ( string name, AccessRights rights, CancellationToken cancellationToken = default(CancellationToken) ) : void
name string The identity name.
rights AccessRights The access rights.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

SetFlags() public method

Sets the flags of the specified messages only if their mod-sequence value is less than the specified value.
Sets the flags of the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetFlags ( IList uids, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs of the messages.
modseq ulong The mod-sequence value.
flags MessageFlags The message flags to set.
userFlags HashSet A set of user-defined flags to set.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

SetFlags() public method

Sets the flags of the specified messages only if their mod-sequence value is less than the specified value.
Sets the flags of the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The does not support mod-sequences. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetFlags ( IList indexes, ulong modseq, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes of the messages.
modseq ulong The mod-sequence value.
flags MessageFlags The message flags to set.
userFlags HashSet A set of user-defined flags to set.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

SetFlags() public method

Sets the flags of the specified messages.
Sets the flags of the specified messages.
/// is null. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetFlags ( IList uids, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
uids IList The UIDs of the messages.
flags MessageFlags The message flags to set.
userFlags HashSet A set of user-defined flags to set.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

SetFlags() public method

Sets the flags of the specified messages.
Sets the flags of the specified messages.
/// is null. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetFlags ( IList indexes, MessageFlags flags, HashSet userFlags, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
indexes IList The indexes of the messages.
flags MessageFlags The message flags to set.
userFlags HashSet A set of user-defined flags to set.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

SetLabels() public method

Set the labels of the specified messages only if their mod-sequence value is less than the specified value.
Sets the labels of the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetLabels ( IList uids, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The UIDs of the messages.
modseq ulong The mod-sequence value.
labels IList The labels to set.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

SetLabels() public method

Set the labels of the specified messages only if their mod-sequence value is less than the specified value.
Sets the labels of the specified messages only if their mod-sequence value is less than the specified value.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetLabels ( IList indexes, ulong modseq, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : IList
indexes IList The indexes of the messages.
modseq ulong The mod-sequence value.
labels IList The labels to set.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

SetLabels() public method

Set the labels of the specified messages.
Sets the labels of the specified messages.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetLabels ( IList uids, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
uids IList The UIDs of the messages.
labels IList The labels to set.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

SetLabels() public method

Sets the labels of the specified messages.
Sets the labels of the specified messages.
/// is null. /// -or- /// is null. /// /// One or more of the is invalid. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open in read-write mode. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetLabels ( IList indexes, IList labels, bool silent, CancellationToken cancellationToken = default(CancellationToken) ) : void
indexes IList The indexes of the messages.
labels IList The labels to set.
silent bool If set to true, no events will be emitted.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

SetMetadata() public method

Sets the specified metadata.
Sets the specified metadata.
/// is null. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the METADATA extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetMetadata ( MetadataCollection metadata, CancellationToken cancellationToken = default(CancellationToken) ) : void
metadata MetadataCollection The metadata.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

SetQuota() public method

Set the quota limits for the folder.

Sets the quota limits for the folder.

To determine if a quotas are supported, check the ImapClient.SupportsQuotas property.

/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The IMAP server does not support the QUOTA extension. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SetQuota ( uint messageLimit, uint storageLimit, CancellationToken cancellationToken = default(CancellationToken) ) : FolderQuota
messageLimit uint If not null, sets the maximum number of messages to allow.
storageLimit uint If not null, sets the maximum storage size (in kilobytes).
cancellationToken System.Threading.CancellationToken The cancellation token.
return FolderQuota

Sort() public method

Sort messages matching the specified query.
The returned array of unique identifiers will be sorted in the preferred order and can be used with IMailFolder.GetMessage(UniqueId,CancellationToken,ITransferProgress).
/// is null. /// -or- /// is null. /// /// is empty. /// /// One or more search terms in the are not supported by the IMAP server. /// -or- /// The server does not support the SORT extension. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Sort ( SearchQuery query, IList orderBy, CancellationToken cancellationToken = default(CancellationToken) ) : IList
query MailKit.Search.SearchQuery The search query.
orderBy IList The sort order.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Sort() public method

Sort messages matching the specified query.
Searches the folder for messages matching the specified query, returning the search results in the specified sort order.
/// is null. /// -or- /// is null. /// /// is empty. /// /// One or more search terms in the are not supported by the IMAP server. /// -or- /// The IMAP server does not support the ESORT extension. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Sort ( SearchOptions options, SearchQuery query, IList orderBy, CancellationToken cancellationToken = default(CancellationToken) ) : SearchResults
options SearchOptions The search options.
query MailKit.Search.SearchQuery The search query.
orderBy IList The sort order.
cancellationToken System.Threading.CancellationToken The cancellation token.
return MailKit.Search.SearchResults

Sort() public method

Sort messages matching the specified query.
Sends a UID SORT command with the specified query passed directly to the IMAP server with no interpretation by MailKit. This means that the query may contain any arguments that a UID SORT command is allowed to have according to the IMAP specifications and any extensions that are supported, including RETURN parameters.
/// is null. /// /// is an empty string. /// /// The IMAP server does not support the SORT extension. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Sort ( string query, CancellationToken cancellationToken = default(CancellationToken) ) : SearchResults
query string The search query.
cancellationToken System.Threading.CancellationToken The cancellation token.
return MailKit.Search.SearchResults

SortAsync() public method

Asynchronously sort messages matching the specified query.
Sends a UID SORT command with the specified query passed directly to the IMAP server with no interpretation by MailKit. This means that the query may contain any arguments that a UID SORT command is allowed to have according to the IMAP specifications and any extensions that are supported, including RETURN parameters.
/// is null. /// /// is an empty string. /// /// The IMAP server does not support the SORT extension. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public SortAsync ( string query, CancellationToken cancellationToken = default(CancellationToken) ) : Task
query string The search query.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

Status() public method

Updates the values of the specified items.

Updates the values of the specified items.

The Status(StatusItems, System.Threading.CancellationToken) method MUST NOT be used on a folder that is already in the opened state. Instead, other ways of getting the desired information should be used.

For example, a common use for the Status(StatusItems,System.Threading.CancellationToken) method is to get the number of unread messages in the folder. When the folder is open, however, it is possible to use the ImapFolder.Search(MailKit.Search.SearchQuery, System.Threading.CancellationToken) method to query for the list of unread messages.

For more information about the STATUS command, see rfc3501.

/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The does not exist. /// /// The IMAP server does not support the STATUS command. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Status ( StatusItems items, CancellationToken cancellationToken = default(CancellationToken) ) : void
items StatusItems The items to update.
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

Subscribe() public method

Subscribes the folder.
Subscribes the folder.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Subscribe ( CancellationToken cancellationToken = default(CancellationToken) ) : void
cancellationToken System.Threading.CancellationToken The cancellation token.
return void

Thread() public method

Threads the messages in the folder that match the search query using the specified threading algorithm.
The MessageThread.UniqueId can be used with methods such as IMailFolder.GetMessage(UniqueId,CancellationToken,ITransferProgress).
/// is not supported. /// /// is null. /// -or- /// is null. /// /// is empty. /// -or- /// One or more of the is invalid. /// /// One or more search terms in the are not supported by the IMAP server. /// -or- /// The server does not support the THREAD extension. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Thread ( IList uids, ThreadingAlgorithm algorithm, SearchQuery query, CancellationToken cancellationToken = default(CancellationToken) ) : IList
uids IList The subset of UIDs
algorithm ThreadingAlgorithm The threading algorithm to use.
query MailKit.Search.SearchQuery The search query.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Thread() public method

Threads the messages in the folder that match the search query using the specified threading algorithm.
The MessageThread.UniqueId can be used with methods such as IMailFolder.GetMessage(UniqueId,CancellationToken,ITransferProgress).
/// is not supported. /// /// is null. /// /// One or more search terms in the are not supported by the IMAP server. /// -or- /// The server does not support the THREAD extension. /// /// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The is not currently open. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Thread ( ThreadingAlgorithm algorithm, SearchQuery query, CancellationToken cancellationToken = default(CancellationToken) ) : IList
algorithm ThreadingAlgorithm The threading algorithm to use.
query MailKit.Search.SearchQuery The search query.
cancellationToken System.Threading.CancellationToken The cancellation token.
return IList

Unsubscribe() public method

Unsubscribes the folder.
Unsubscribes the folder.
/// The has been disposed. /// /// The is not connected. /// /// The is not authenticated. /// /// The operation was canceled via the cancellation token. /// /// An I/O error occurred. /// /// The server's response contained unexpected tokens. /// /// The server replied with a NO or BAD response. ///
public Unsubscribe ( CancellationToken cancellationToken = default(CancellationToken) ) : void
cancellationToken System.Threading.CancellationToken The cancellation token.
return void