Method DeleteFolderAsync
- Namespace
- MailFathom.Application.Folders
- Assembly
- MailFathom.Application.dll
DeleteFolderAsync(MailAccountId, MailFolderAlias, RemoteFolderPath, MailTransportSecurityPolicy, CancellationToken)
Deletes a folder, with whatever the server holds in it.
Task DeleteFolderAsync(MailAccountId accountId, MailFolderAlias folderAlias, RemoteFolderPath path, MailTransportSecurityPolicy transportSecurityPolicy, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe account whose mailbox loses the folder.
folderAliasMailFolderAliasThe folder alias the path is declared under, which is the name every failure reports.
pathRemoteFolderPathThe path the folder is at.
transportSecurityPolicyMailTransportSecurityPolicyThe connection and authentication policy the implementation must obey.
cancellationTokenCancellationTokenCancels waiting for the account's write connection, connecting, authenticating, and deleting.
Returns
- Task
A task that completes when the server no longer holds the folder.
Remarks
A folder the server no longer advertises is the successful answer rather than a failure, because another mail client may have deleted it between the listing that found it and this attempt — the same reading a creation gives a folder that is already there. Nothing is unsubscribed: a deleted folder's subscription is the server's to forget, and unsubscribing stays outside what ADR 0007 permits.
Exceptions
- ArgumentNullException
Thrown when
transportSecurityPolicyis null.- RemoteFolderEditRefusedException
Thrown when the mail server answered and refused to delete the folder.
- MailboxUnavailableException
Thrown when the mail server did not serve the deletion within its configured resilience budget.