Method ScreenAsync
- Namespace
- MailFathom.Application.SensitiveContent.Egress
- Assembly
- MailFathom.Application.dll
ScreenAsync(SensitiveContentEgressPoint, MailAccountId, IReadOnlyList<string>, CancellationToken)
Screens every text of one act, and reports the first thing that stops it.
public Task<SensitiveContentEgressRefusal?> ScreenAsync(SensitiveContentEgressPoint egressPoint, MailAccountId account, IReadOnlyList<string> texts, CancellationToken cancellationToken)
Parameters
egressPointSensitiveContentEgressPointWhere the texts were about to go.
accountMailAccountIdThe account the message is about to leave, whose posture the findings are judged by.
textsIReadOnlyList<string>The texts to screen, each a value rather than a document composed around one.
cancellationTokenCancellationTokenCancels the scan.
Returns
- Task<SensitiveContentEgressRefusal>
What stopped the act, or null where nothing did.
Remarks
It stops at the first text that refuses rather than screening the rest, because the act is refused whichever text carried the material and every further scan would be a round trip spent on an act that is already not happening. Which text it was is deliberately not reported: an author told the subject rather than the body carried a credential has been told where to look for it in a message a log line will outlive.
Each text is scanned on its own for the reason the guard scans a collection that way — a joined scan would let a detection straddle the join between a subject and a body that have nothing to do with each other.
Exceptions
- ArgumentNullException
Thrown when
textsis null, or one of them is.- SensitiveContentScannerUnavailableException
Thrown when a switched-on scanner could not establish what a text carries, which stops the act without saying what was in it.
- OperationCanceledException
Thrown when
cancellationTokenis cancelled.