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
occurrenceIdEmailOccurrenceIdThe occurrence to remove, which must belong to this session's account, folder, and UIDVALIDITY.
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.
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
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.- 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.