Table of Contents

Method DeleteAsync

Namespace
MailFathom.Application.Mail.Mutations
Assembly
MailFathom.Application.dll

DeleteAsync(EmailOccurrenceId, IMailboxMutationJournal, CancellationToken)

Removes one email from this session's folder on the server.

Task DeleteAsync(EmailOccurrenceId occurrenceId, IMailboxMutationJournal journal, CancellationToken cancellationToken)

Parameters

occurrenceId EmailOccurrenceId

The occurrence to remove, which must belong to this session's account, folder, and UIDVALIDITY.

journal IMailboxMutationJournal

The durable record of this deletion, which the session announces each stage to and resumes from.

cancellationToken CancellationToken

Cancels the deletion.

Returns

Task

A task that completes when the server has removed the email.

Remarks

What becomes of the local copy is not decided here. This operation says the message is gone from the server, and nothing else, so an account's disposition for mail somebody else deleted never silently governs mail MailFathom deleted. The remote \Seen flag is untouched.

Exceptions

ArgumentException

Thrown when occurrenceId does not belong to this session.

ArgumentNullException

Thrown when journal is null.

MailboxMutationUnsupportedException

Thrown when the server advertises no UIDPLUS, so no message-scoped expunge exists.

MailboxUnavailableException

Thrown when the mail server did not serve the deletion within its configured resilience budget.

MailboxFolderRecreatedException

Thrown when a recovered connection reselected the folder with a different UIDVALIDITY.