Table of Contents

Method SetSeenAsync

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

SetSeenAsync(EmailOccurrenceId, bool, IMailboxMutationJournal, CancellationToken)

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

Task SetSeenAsync(EmailOccurrenceId occurrenceId, bool isSeen, IMailboxMutationJournal journal, CancellationToken cancellationToken)

Parameters

occurrenceId EmailOccurrenceId

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

isSeen bool

true to mark the email read; false to mark it unread.

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

Both directions are the same mutation, because both are the same authored act about the same flag. This is the only operation in MailFathom that writes \Seen; the stored value stays a snapshot of what the server reports, written by synchronization observing the result rather than by this call.

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.