Table of Contents

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

accountId MailAccountId

The account whose mailbox loses the folder.

folderAlias MailFolderAlias

The folder alias the path is declared under, which is the name every failure reports.

path RemoteFolderPath

The path the folder is at.

transportSecurityPolicy MailTransportSecurityPolicy

The connection and authentication policy the implementation must obey.

cancellationToken CancellationToken

Cancels 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 transportSecurityPolicy is 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.