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
occurrenceIdEmailOccurrenceIdThe occurrence to fetch, which must belong to this session's account, folder, and UIDVALIDITY.
maxRawMimeByteslongThe size beyond which the payload is abandoned rather than buffered.
cancellationTokenCancellationTokenCancels the fetch and every remaining attempt.
Returns
- Task<RemoteEmailContentFetchResult>
The raw MIME content of the occurrence, or the statement that it exceeded
maxRawMimeBytes.
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.
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.