Class MailboxSearchReader
- Namespace
- MailFathom.Application.Emails.SearchEmails
- Assembly
- MailFathom.Application.dll
Searches the local mailbox copy for text and returns one bounded, ranked window of results.
public sealed class MailboxSearchReader
- Inheritance
-
MailboxSearchReader
- Inherited Members
Remarks
The use case owns everything between an unvalidated request and a window: it normalizes and bounds the structured filters, validates the free text, refuses an account this deployment does not serve, and decides the effective result count and the snippet bounds. Storage does none of that, and no protocol adapter repeats it.
It reaches no mail server. A search answers from what synchronization has already stored and what extraction has already indexed, which is what keeps an MCP read independent of IMAP availability, and it reports how current that copy is instead of pretending it is live.
It answers lexically or hybridly according to what the instance can do at the moment of the call, and reports which in the result. Nothing about the request selects between them: retrieval quality is a deployment's decision, and a caller able to ask for the lexical ranking of a hybrid instance would be asking for worse results with no way to know it.
Beside the mode it reports what semantic retrieval can do at all, so a lexical answer says whether this instance never embeds or is currently unable to. A search never fails because an embedding provider did, and never returns an empty window in place of one it could not rank semantically.
The index covers the text of the documents attached to a message as well as its body, so a clause a sender put in a PDF is found by the words it is written in. What an attachment contributed is reported as its own match — naming the file and the page it was read from — rather than folded into the message's snippets, and neither the ranking nor the result ever carries a whole attachment.
A picture is reached only by what a model said it shows, and a result placed by one of those descriptions sits below every message a query word or a passage somebody wrote reached. That floor is HybridSearchRanking's rather than this use case's, because ADR 0030 requires one step every surface calls instead of a rule each of them remembers.
A window is one of the points mail content leaves this deployment, so where a sensitive-content scanner is switched on the content of a result is scanned before the result is returned, and a scanner that cannot answer refuses the search rather than serving it unscanned. The guard is here rather than at the protocol boundary for the reason the authorization above it is: a second entrypoint over this use case inherits it instead of repeating it.
Constructors
Methods
- SearchEmailsAsync(SearchEmailsRequest, CancellationToken)
Searches for one window of ranked emails and publishes it to a caller outside this process.