Class OutgoingMailScreening
- Namespace
- MailFathom.Application.Mail.Delivery.Screening
- Assembly
- MailFathom.Application.dll
Asks whether one composed message may be put on a mail server at all, before anything is written down.
public sealed class OutgoingMailScreening
- Inheritance
-
OutgoingMailScreening
- Inherited Members
Remarks
It is asked by the outbox and by the draft book rather than by an entrypoint, which is what makes it unbypassable and is the same reasoning the send governor is placed by: those two are the one way a message becomes durable, so a caller, a rule, a promotion, a recurring occasion, and whatever asks next all meet the screen without any of them carrying a copy of it. A message reaching the outbox by a route added later is screened because it reaches the outbox, not because whoever wrote that route remembered to.
The bytes are what is read rather than the fields an author supplied, and that is deliberate: half the routes into the outbox have no authored fields at all — a promoted draft and a recurring occasion are a stored message and a recomposition of one — and screening the composed bytes is the one reading that covers every route identically. It also screens what will actually be transmitted rather than what somebody typed.
Nothing is parsed where nothing screens the mail leaving this account. The screen answers whether it is active for that mailbox before the message is read back, so an opt-in nobody took costs a send no parse, no allocation, no document read, and no scan — and an account that added a category pays for one while the account beside it does not. That test is what keeps the attachment reading below out of the cost of an unscreened send entirely.
What the message attaches is screened with what it says, and a document nothing here could read stops the act rather than passing as clean. A file is refused after the scan rather than before it, so a message that carries both a credential and a locked archive is refused for the credential, which is the half its author can do something about.
Constructors
- OutgoingMailScreening(IOutgoingMailTextReader, SensitiveContentEgressScreen)
Asks whether one composed message may be put on a mail server at all, before anything is written down.
Methods
- FindRefusalAsync(MailAccountId, ReadOnlyMemory<byte>, CancellationToken)
Screens one composed message and reports what stops it, if anything does.