Table of Contents

Method OpenAsync

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

OpenAsync(MailAccountId, MailFolderResolution, MailTransportSecurityPolicy, CancellationToken)

Opens a session that waits for changes to one folder, or reports that the server cannot serve one.

Task<MailboxNotificationSessionResult> OpenAsync(MailAccountId accountId, MailFolderResolution folder, MailTransportSecurityPolicy transportSecurityPolicy, CancellationToken cancellationToken)

Parameters

accountId MailAccountId

The local account identifier.

folder MailFolderResolution

The alias binding whose remote path the session waits on, selected read-only.

transportSecurityPolicy MailTransportSecurityPolicy

The connection and authentication policy the implementation must obey.

cancellationToken CancellationToken

Cancels connecting, authenticating, and selecting the folder.

Returns

Task<MailboxNotificationSessionResult>

An open session the caller owns and must dispose, or the statement that the server advertises no push mechanism.

Remarks

A server that advertises no push mechanism is an ordinary answer rather than a failure, because the caller polls instead and the account keeps synchronizing. It is reported as a result for that reason, and reported at all because an operator who configured push needs to see that the server declined it.

The capability is decided per open session rather than once per process. A server can gain or lose the mechanism across a restart or behind a load balancer, and a session that re-establishes itself asks again.

Exceptions

ArgumentNullException

Thrown when folder is null.

MailboxUnavailableException

Thrown when the mail server did not accept the session within its configured resilience budget.