Method DeleteAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
DeleteAsync(EmailOccurrenceId, AuthoredDeleteServerDisposition, IMailboxMutationJournal, CancellationToken)
Removes one email from this session's folder on the server.
Task DeleteAsync(EmailOccurrenceId occurrenceId, AuthoredDeleteServerDisposition serverDisposition, IMailboxMutationJournal journal, CancellationToken cancellationToken)
Parameters
occurrenceIdEmailOccurrenceIdThe occurrence to remove, which must belong to this session's account, folder, and UIDVALIDITY.
serverDispositionAuthoredDeleteServerDispositionWhether the email is expunged or only flagged
\Deleted, as the delete was recorded under.journalIMailboxMutationJournalThe durable record of this deletion, which the session announces each stage to and resumes from.
cancellationTokenCancellationTokenCancels the deletion.
Returns
- Task
A task that completes when the server has removed the email, or flagged it where only that was asked for.
Remarks
What becomes of the local copy is not decided here. This operation says what the server now does with the
message, 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
occurrenceIddoes not belong to this session.- ArgumentNullException
Thrown when
journalis null.- MailboxMutationUnsupportedException
Thrown when the server advertises no
UIDPLUS, so no message-scoped expunge exists. A delete that only flags is refused on the same server as well, so what a server can delete does not depend on an account setting.- 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.