Constructor EmailSpamClassifier
- Namespace
- MailFathom.Application.Spam
- Assembly
- MailFathom.Application.dll
EmailSpamClassifier(IClassifiableEmailReader, IEmailContentStore, IEmailSpamHeaderReader, IJunkMailFolderCatalog, DeterministicSpamClassifier, ISpamClassificationSettingsReader, IEmailSpamClassificationStore, IEmailChunkStore, IDerivedWorkGateTelemetry, OptimisticConcurrencyRetryPolicy, TimeProvider, ISpamScanner?)
Initializes the use case.
public EmailSpamClassifier(IClassifiableEmailReader emailReader, IEmailContentStore contentStore, IEmailSpamHeaderReader headerReader, IJunkMailFolderCatalog junkFolders, DeterministicSpamClassifier deterministicClassifier, ISpamClassificationSettingsReader settingsReader, IEmailSpamClassificationStore classificationStore, IEmailChunkStore chunkStore, IDerivedWorkGateTelemetry gateTelemetry, OptimisticConcurrencyRetryPolicy retryPolicy, TimeProvider timeProvider, ISpamScanner? scanner = null)
Parameters
emailReaderIClassifiableEmailReaderFinds the account and folder of the occurrence.
contentStoreIEmailContentStoreReads the raw MIME already stored for it.
headerReaderIEmailSpamHeaderReaderReads the spam-relevant headers out of that content.
junkFoldersIJunkMailFolderCatalogAnswers whether the occurrence's folder is its account's junk folder.
deterministicClassifierDeterministicSpamClassifierReaches a verdict from what the message already carried.
settingsReaderISpamClassificationSettingsReaderAnswers what the operator decided.
classificationStoreIEmailSpamClassificationStoreRecords the classification.
chunkStoreIEmailChunkStoreRemoves the passages and vectors of a message the verdict calls junk.
gateTelemetryIDerivedWorkGateTelemetryCounts what a junk verdict had to remove, without describing any of it.
retryPolicyOptimisticConcurrencyRetryPolicyCommits the record from a fresh read when a concurrent write conflicts.
timeProviderTimeProviderStamps the evaluation time.
scannerISpamScannerScores the whole message, or null when no scanner is registered.
Remarks
The scanner is the one optional dependency, because a deployment with no sidecar registers no implementation of the port and the deterministic stage is the whole working feature without one. An absent scanner is therefore a supported deployment rather than a misconfiguration, which is why it is a nullable dependency instead of a guard.
Exceptions
- ArgumentNullException
Thrown when any argument but
scanneris null.