ImapFolderSetQuotaAsync Method

Asynchronously set the quota limits for the folder.

Definition

Namespace: MailKit.Net.Imap
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public override Task<FolderQuota> SetQuotaAsync(
	long? messageLimit,
	long? storageLimit,
	CancellationToken cancellationToken = default
)

Parameters

messageLimit  NullableInt64
If not , sets the maximum number of messages to allow.
storageLimit  NullableInt64
If not , sets the maximum storage size (in kilobytes).
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

TaskFolderQuota
The folder quota.

Implements

IMailFolderSetQuotaAsync(NullableInt64, NullableInt64, CancellationToken)
IMailFolderSetQuotaAsync(NullableInt64, NullableInt64, CancellationToken)

Remarks

Sets the quota limits for the folder.

Any limit that is not specified is removed. If both messageLimit and storageLimit are , then all limits are removed.

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

Exceptions

ArgumentOutOfRangeException

messageLimit is negative.

-or-

storageLimit is negative.

ObjectDisposedException The ImapClient has been disposed.
ServiceNotConnectedException The ImapClient is not connected.
ServiceNotAuthenticatedException The ImapClient is not authenticated.
NotSupportedException The IMAP server does not support the QUOTA extension or does not support setting quota limits (it advertises one or more QUOTA=RES-* capabilities but not QUOTASET).
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