ImapFolderOpen(FolderAccess, UInt32, UInt64, IListUniqueId, CancellationToken) Method

Open the folder using the requested folder access.

Definition

Namespace: MailKit.Net.Imap
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public override FolderAccess Open(
	FolderAccess access,
	uint uidValidity,
	ulong highestModSeq,
	IList<UniqueId> uids,
	CancellationToken cancellationToken = default
)

Parameters

access  FolderAccess
The requested folder access.
uidValidity  UInt32
The last known UidValidity value.
highestModSeq  UInt64
The last known HighestModSeq value.
uids  IListUniqueId
The last known list of unique message identifiers.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

FolderAccess
The FolderAccess state of the folder.

Implements

IMailFolderOpen(FolderAccess, UInt32, UInt64, IListUniqueId, CancellationToken)
IMailFolderOpen(FolderAccess, UInt32, UInt64, IListUniqueId, CancellationToken)

Remarks

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

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

Exceptions

ArgumentOutOfRangeException access is not a valid value.
ObjectDisposedException The ImapClient has been disposed.
ServiceNotConnectedException The ImapClient is not connected.
ServiceNotAuthenticatedException The ImapClient is not authenticated.
FolderNotFoundException The ImapFolder does not exist.
InvalidOperationException The QRESYNC feature has not been enabled.
NotSupportedException The IMAP server does not support the QRESYNC extension.
OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.
ImapProtocolException The server's response contained unexpected tokens.
ImapCommandException The server replied with a NO or BAD response.

See Also