Class MailboxQuestionReader
- Namespace
- MailFathom.Application.Retrieval.AskMail
- Assembly
- MailFathom.Application.dll
Answers one question about the local mailbox copy, names the emails the answer was drawn from, and records the run.
public sealed class MailboxQuestionReader
- Inheritance
-
MailboxQuestionReader
- Inherited Members
Remarks
The use case owns everything between an unvalidated request and a published answer: it bounds the question, refuses an account this deployment does not serve, decides whether this deployment can answer at all, admits the question against what this period may still spend, cuts what one response may carry, and reports what the run did. The agent behind the answering port does none of that, and no protocol adapter repeats it.
The scope is resolved here and again underneath. This resolution is the access decision — an account nobody configured is refused before a provider is reached — and the search the run retrieves through resolves it a second time on every lookup the model makes. The repetition is the point: the model writes the query and never the scope, so a run that has been talked into asking about another account has the caller's own scope searched for those words.
It reaches no mail server. A question is answered from what synchronization has already stored, which is what keeps asking one independent of IMAP availability, and there is nothing in the run that can send, delete, move, or mark mail as read — a property of what the agent is composed of rather than a rule observed here.
Reporting the run is two things, and they are separate because they answer different questions and outlive the request by different amounts. The span says how long the run took, how much it considered, and how it ended, beside the tool call it happened inside; the record says which messages it read, durably, on a deployment exporting nothing. Both are published however the run ended — a run that failed on its third provider call has already read somebody's mail, and a report built from the answer alone would say it read nothing.
Neither the question nor the answer nor a citation's subject is written to a log, a span, or the record by anything on this path. A question is personal data of a particularly revealing kind, and an answer is mail content restated.
An answer and its citations are the last point at which a run's mail content leaves this deployment, so where a sensitive-content scanner is switched on both are scanned before they are published, and a scanner that cannot answer refuses the response rather than serving it unscanned. What reached the model on the way there was scanned as it was retrieved, which is a different egress point with a guard of its own.
Constructors
- MailboxQuestionReader(MailAnsweringCapability, MailboxScopeResolver, IMailAnsweringSpendLedger, MailAnswerBounds, IMailAnsweringRunTelemetry, IMailAnsweringAuditTrail, TimeProvider, SensitiveContentEgressGuard)
Initializes the use case.
Methods
- AnswerQuestionAsync(AskMailRequest, CancellationToken)
Answers one question from the mail within its scope.