Table of Contents

Method SetFlaggedAsync

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

SetFlaggedAsync(EmailOccurrenceId, bool, IMailboxMutationJournal, CancellationToken)

Sets or clears the remote \Flagged flag of one email in this session's folder.

Task SetFlaggedAsync(EmailOccurrenceId occurrenceId, bool isFlagged, IMailboxMutationJournal journal, CancellationToken cancellationToken)

Parameters

occurrenceId EmailOccurrenceId

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

isFlagged bool

true to flag the email; false to clear the flag.

journal IMailboxMutationJournal

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

cancellationToken CancellationToken

Cancels the flag write.

Returns

Task

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

Remarks

The \Seen flag is not part of this operation. Both write one flag and leave every other one exactly as the server holds it, which is what keeps each of them the answer to the question it was asked.

Exceptions

ArgumentException

Thrown when occurrenceId does not belong to this session.

ArgumentNullException

Thrown when journal is null.

MailboxUnavailableException

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

MailboxFolderRecreatedException

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