Class EmailAttachmentTextDeriver
- Namespace
- MailFathom.Application.Emails.AttachmentText
- Assembly
- MailFathom.Application.dll
Reads every attachment of one stored message and says, for each, what it yielded or why it yielded nothing.
public sealed class EmailAttachmentTextDeriver
- Inheritance
-
EmailAttachmentTextDeriver
- Inherited Members
Remarks
The whole of the derivation happens here and none of it touches the database, which is the ordering the rest of this path depends on: parsing a sender's document and describing a picture are the two slowest and least trustworthy things this system does, and neither may run inside an open transaction. What the caller receives is a list of values it can commit in one statement.
Which of the two ports reads an attachment is decided by the extractor and not here. It answers FormatNotRecognized for anything whose media type and file name name no document format, before it buffers an octet — so a picture reaches the describer by falling through that answer rather than by a second copy of the format table kept in this file. Everything else the extractor answers is final, including a document it declines to read: a spreadsheet nothing parses is not then offered to a vision model. What a document it did read hands back beside its text are the pictures inside it, where the deployment reads pictures, and those reach the describer here one at a time — a scanned PDF's page is a picture of an invoice exactly as a JPEG attachment is.
Nothing reaches a mail server. The octets are the stored raw MIME, read through the content store, and the attachment is opened by the same walk position the download route is addressed with — so a citation into an attachment resolves to the file a reader would actually open.
Everything it produces is redacted before it is returned. Attachment text is derived mail content exactly as a body is, so it passes the same SensitiveContentDerivationGuard every other derived write goes through, and inherits the stamp with it. A description is redacted too: a model asked what a picture shows will read out the account number printed on it.
Constructors
- EmailAttachmentTextDeriver(IEmailContentStore, IEmailAttachmentContentReader, IAttachmentTextExtractor, IEmailAttachmentImageDescriber, SensitiveContentDerivationGuard, IEmailContentRepairRequestStore, AttachmentTextExtractionOptions, EmailAttachmentTextBounds, ProviderRequestPacer)
Initializes the derivation from the stores and ports one message's attachments are read through.
Methods
- DeriveAsync(EmailAwaitingAttachmentText, EmailAttachmentTextRunBudget, CancellationToken)
Reads the attachments of one message.