Table of Contents

Method FetchEmailContentWithoutSettingSeenAsync

Namespace
MailFathom.Application.Synchronization.Sessions
Assembly
MailFathom.Application.dll

FetchEmailContentWithoutSettingSeenAsync(EmailOccurrenceId, long, CancellationToken)

Fetches raw MIME content with a BODY.PEEK-style operation that preserves the remote Seen flag.

Task<RemoteEmailContentFetchResult> FetchEmailContentWithoutSettingSeenAsync(EmailOccurrenceId occurrenceId, long maxRawMimeBytes, CancellationToken cancellationToken)

Parameters

occurrenceId EmailOccurrenceId

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

maxRawMimeBytes long

The size beyond which the payload is abandoned rather than buffered.

cancellationToken CancellationToken

Cancels the fetch and every remaining attempt.

Returns

Task<RemoteEmailContentFetchResult>

The raw MIME content of the occurrence, the statement that it exceeded maxRawMimeBytes, or the statement that the folder no longer holds it.

Remarks

An oversized payload is a result rather than a failure, because a caller records the occurrence and steps over it instead of stopping the run. The preservation guarantee holds on every attempt: an implementation that recovers a lost connection must reselect the folder read-only before it fetches again.

So is an occurrence the folder has stopped holding. A message can leave between the moment a run learned of it and the moment its body is asked for, and every later attempt would receive the same answer, so an implementation reports it rather than failing the caller's whole run on a message that no longer exists.

Exceptions

MailboxUnavailableException

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

MailboxFolderRecreatedException

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