Class EmailContentReader
- Namespace
- MailFathom.Application.Emails.GetEmailContent
- Assembly
- MailFathom.Application.dll
Reads the content of the emails one call names, from the local mailbox copy.
public sealed class EmailContentReader
- Inheritance
-
EmailContentReader
- Inherited Members
Remarks
The use case owns the whole path from identifiers to readable messages: it establishes that each email belongs to an account this deployment serves, decides whether content exists to read at all, verifies that what is stored is what was written, has it rendered, and turns a damaged local copy into a stable per-email failure and a durable repair request.
A read names several emails and answers for each of them separately, because one identifier this deployment cannot serve must not discard the content of the others. What it refuses outright is the request rather than an email: a list naming nothing, a list longer than one call serves, and a list naming the same email twice are all decided before anything is read.
Two bounds stand between a caller and a mailbox, and both are the deployment's rather than the request's. Each body representation is bounded on its own, and the call as a whole has a character budget spent in the order the emails were named. Every representation states which of the two cut it, so a caller can tell a message worth reading alone from a batch worth splitting.
It reaches no mail server. That is the acceptance criterion this operation exists under rather than a property it
happens to have: reading mail must never download it and must never set the remote \Seen flag, so a missing
local copy is answered with a failure and a repair request instead of a fetch. The use case holds no mailbox port,
which is what makes the guarantee structural rather than a rule someone has to keep.
Constructors
- EmailContentReader(IStoredEmailSummaryReader, IEmailContentStore, IEmailContentRenderer, IEmailContentRepairRequestStore, IMailAccountCatalog, EmailContentReadOptions)
Initializes the use case.
Methods
- ReadContentAsync(GetEmailContentRequest, CancellationToken)
Reads every email the request names.