Method SearchEmailsAsync
- Namespace
- MailFathom.Application.Emails.SearchEmails
- Assembly
- MailFathom.Application.dll
SearchEmailsAsync(SearchEmailsRequest, CancellationToken)
Searches for one window of ranked emails.
public Task<SearchEmailsResult> SearchEmailsAsync(SearchEmailsRequest request, CancellationToken cancellationToken)
Parameters
requestSearchEmailsRequestWhat the caller asked for.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<SearchEmailsResult>
The ranked window 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. A query that matches nothing returns
an empty window rather than a failure, so a search cannot be used to establish that a folder or an account holds
mail the caller was not already entitled to see.
Exceptions
- ArgumentNullException
Thrown when
requestis null.- MailboxQueryFilterInvalidException
Thrown when the query text is blank or unusable, or a structured 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.
- EmailSearchResultLimitOutOfRangeException
Thrown when the request names a result count outside the accepted range.