Method OpenReadOnlyAsync
- Namespace
- MailFathom.Application.Synchronization.Sessions
- Assembly
- MailFathom.Application.dll
OpenReadOnlyAsync(MailAccountId, MailFolderResolution, MailTransportSecurityPolicy, CancellationToken)
Opens a folder read-only so synchronization cannot mutate remote mailbox state.
Task<IMailboxSession> OpenReadOnlyAsync(MailAccountId accountId, MailFolderResolution folder, MailTransportSecurityPolicy transportSecurityPolicy, CancellationToken cancellationToken)
Parameters
accountIdMailAccountIdThe local account identifier.
folderMailFolderResolutionThe alias binding whose remote path is selected read-only.
transportSecurityPolicyMailTransportSecurityPolicyThe connection and authentication policy the implementation must obey.
cancellationTokenCancellationTokenCancels connecting, authenticating, and selecting the folder.
Returns
- Task<IMailboxSession>
An open read-only mailbox session the caller owns and must dispose.
Remarks
The session receives the whole binding rather than a path, because every occurrence identity it produces is scoped by the generation the binding carries.
The policy is an input rather than something the implementation resolves, so an adapter cannot widen the permitted authentication mechanisms or downgrade the connection on its own.
Exceptions
- MailboxUnavailableException
Thrown when the mail server did not accept the session within its configured resilience budget.