Table of Contents

Method ListEmailsAsync

Namespace
MailFathom.Application.Emails.ListEmails
Assembly
MailFathom.Application.dll

ListEmailsAsync(ListEmailsRequest, CancellationToken)

Lists one page of emails.

public Task<ListEmailsResult> ListEmailsAsync(ListEmailsRequest request, CancellationToken cancellationToken)

Parameters

request ListEmailsRequest

What the caller asked for.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<ListEmailsResult>

The page, the cursor that continues the walk when one exists, and the scope's synchronization freshness.

Remarks

Nothing here writes, and the operation is therefore safe to repeat. It also never sets the remote \Seen flag or any other remote state, because it speaks to no mail server at all.

The grant is asked for before the request is validated, so a caller that may not read learns nothing about which filters this deployment accepts, and it is asked for here rather than only at the transport that withholds the tool, so an entrypoint added later cannot list mail by forgetting a filter.

Exceptions

ArgumentNullException

Thrown when request is null.

MailboxQueryFilterInvalidException

Thrown when a filter carries a value, a count, or a length the query does not accept.

MailAccountNotAccessibleException

Thrown when the request names an account this deployment does not serve.

MailboxQueryPageSizeOutOfRangeException

Thrown when the request names a page size outside the accepted range.

MailboxQueryCursorMalformedException

Thrown when the request carries a cursor this system did not issue.

MailboxQueryCursorFilterMismatchException

Thrown when the cursor was issued for different filters than the request carries.

SensitiveContentScannerUnavailableException

Thrown when a switched-on scanner could not establish what the page carries, which refuses the listing rather than serving it unscanned.

PrincipalNotAuthorizedException

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