Table of Contents

Method SetKeywordsAsync

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

SetKeywordsAsync(EmailOccurrenceId, AuthoredMailKeywords, IMailboxMutationJournal, CancellationToken)

Makes one email's keywords exactly the set that was named, in this session's folder.

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

Parameters

occurrenceId EmailOccurrenceId

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

keywords AuthoredMailKeywords

The keywords it should end up carrying, which may be none and then clears them all.

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 set.

Remarks

This never issues the STORE FLAGS the operation's name suggests. That command replaces a message's entire flag set, so it would clear \Seen, \Flagged, \Answered, and \Draft as a side effect of writing a label — flags this system either owns through one deliberate operation each or refuses to write at all. What the implementation does instead is its own business; what this contract promises is that only keywords move.

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.