Table of Contents

Method GuardOptionalAsync

Namespace
MailFathom.Application.SensitiveContent.Egress
Assembly
MailFathom.Application.dll

GuardOptionalAsync(SensitiveContentEgressPoint, string?, CancellationToken)

Guards a text that a message need not carry at all.

public Task<string?> GuardOptionalAsync(SensitiveContentEgressPoint egressPoint, string? text, CancellationToken cancellationToken)

Parameters

egressPoint SensitiveContentEgressPoint

Where the text is going.

text string

The text to guard, or null where the message carried none.

cancellationToken CancellationToken

Cancels the scan.

Returns

Task<string>

The guarded text, or null where there was none.

Remarks

Absence is carried through rather than turned into an empty string, because a subject nobody wrote and a subject redacted to nothing are different facts and a reader acts differently on each.

Exceptions

SensitiveContentScannerUnavailableException

Thrown when a switched-on scanner could not establish what the text carries, which refuses the egress.

OperationCanceledException

Thrown when cancellationToken is cancelled.