Table of Contents

Method AddKeywordsAsync

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

AddKeywordsAsync(EmailOccurrenceId, AuthoredMailKeywords, IMailboxMutationJournal, CancellationToken)

Puts keywords on one email in this session's folder, beside the ones it already carries.

Task AddKeywordsAsync(EmailOccurrenceId occurrenceId, AuthoredMailKeywords keywords, IMailboxMutationJournal journal, CancellationToken cancellationToken)

Parameters

occurrenceId EmailOccurrenceId

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

keywords AuthoredMailKeywords

The keywords to put on it.

journal IMailboxMutationJournal

The durable record of this keyword change, which exists for provenance rather than for retry safety.

cancellationToken CancellationToken

Cancels the keyword write.

Returns

Task

A task that completes when the server has recorded the keywords.

Remarks

A keyword the email already carries is asked for again rather than filtered out, because a STORE +FLAGS is idempotent for one UID and reading the message first to avoid it would buy a round trip and a race.

Exceptions

ArgumentException

Thrown when occurrenceId does not belong to this session.

ArgumentNullException

Thrown when an argument is null.

MailboxMutationUnsupportedException

Thrown when the folder will not keep a keyword it was not already keeping.

MailboxUnavailableException

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

MailboxFolderRecreatedException

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