Table of Contents

Method AssessAsync

Namespace
MailFathom.Application.Mail.Maintenance
Assembly
MailFathom.Application.dll

AssessAsync(StoredMailScope, CancellationToken)

Reports how much mail a rewind of one scope would have the next runs read again.

public Task<int> AssessAsync(StoredMailScope scope, CancellationToken cancellationToken)

Parameters

scope StoredMailScope

The account, and the one folder of it, the rewind would cover.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<int>

How many stored emails the scope holds.

Remarks

It is what the scope holds rather than what a run would fetch, and the two differ: mail the server no longer holds is not fetched again, and mail that arrived since is fetched without ever having been stored. Neither difference is knowable without a mailbox session, which this deliberately does not open, and the stored count is the figure of the right order for the decision an operator is making.

It counts rather than discards, so it asks for the permission a report of the deployment's own state is published under and never for the one that performs the rewind.

Exceptions

ArgumentNullException

Thrown when scope is null.

PrincipalNotAuthorizedException

Thrown when the use case was reached by anything but a caller granted AdminRead.