Class SensitiveContentEgressScreen
- Namespace
- MailFathom.Application.SensitiveContent.Egress
- Assembly
- MailFathom.Application.dll
The thing an egress point calls when a finding has to stop the act rather than be removed from a result.
public sealed class SensitiveContentEgressScreen
- Inheritance
-
SensitiveContentEgressScreen
- Inherited Members
Remarks
It is the sibling of SensitiveContentEgressGuard and shares everything with it but the disposition: the same scanners, the same categories and suppressions, the same analyzed ceiling, the same per-call budget, the same concurrency permits, and the same fail-closed answer when a switched-on scanner cannot run. What differs is what a finding means. A guard is asked *how may this text be published*, and answers with the text minus what it found; a screen is asked *may this act happen at all*, and answers yes or no.
The screen exists because redaction is the wrong answer for a message somebody wrote. Replacing a region of an outgoing body would transmit text its author never wrote, under their own address, to a person who has no way of knowing anything was changed — and the author would learn of it, if at all, from the copy in their sent folder. So the act is stopped and the author decides what to do, which is the only disposition that leaves the decision with whoever is accountable for the message.
The redaction behind it is the same instance every other consumer redacts through, and running it is how the findings are reached. The redacted text it produces is discarded here, which costs nothing on the path that matters: a text carrying no finding is returned by that redaction unchanged and unrewritten, so a clean message pays for the scan and for nothing else.
A text the ceiling cut is refused rather than passed. That is the one place a screen must behave differently from a guard and not merely mean something different by the result: a guard drops the remainder and publishes the rest, losing nothing that was never scanned, while a screen asked about a whole message cannot say a tail nobody analyzed is clean. Both readings are fail-closed; they just fail closed about different questions.
With nothing to screen this is inert. It is registered whatever a deployment configured, so no consumer carries a null check or a second code path, and with no redaction or a policy that stops nothing every call answers without constructing a detector, taking a concurrency permit, or touching an instrument.
Which findings stop an act is the account's own posture. The deployment names the categories nothing may carry out of it and an account may add to that set for its own mail, so what an act is judged by is composed from both rather than read off the deployment alone. The account is an argument here because every caller — the outbox, the draft book, and the reader that serves one attachment — holds which mailbox it is acting on before it holds any bytes, and it arrives beside its user so that what is reported about the act still names the person behind it.
Constructors
- SensitiveContentEgressScreen(ISensitiveContentPostures, ISensitiveContentEgressTelemetry, TimeProvider)
Initializes the screen of a deployment, whether or not it screens anything.
Methods
- IsActiveForAsync(MailAccountId, CancellationToken)
Reports whether anything stops one account's message at this kind of egress.
- ScreenAsync(SensitiveContentEgressPoint, MailAccountId, IReadOnlyList<string>, CancellationToken)
Screens every text of one act, and reports the first thing that stops it.