Table of Contents

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

emailReader IClassifiableEmailReader

Finds the account and folder of the occurrence.

contentStore IEmailContentStore

Reads the raw MIME already stored for it.

headerReader IEmailSpamHeaderReader

Reads the spam-relevant headers out of that content.

junkFolders IJunkMailFolderCatalog

Answers whether the occurrence's folder is its account's junk folder.

deterministicClassifier DeterministicSpamClassifier

Reaches a verdict from what the message already carried.

settingsReader ISpamClassificationSettingsReader

Answers what the operator decided.

classificationStore IEmailSpamClassificationStore

Records the classification.

chunkStore IEmailChunkStore

Removes the passages and vectors of a message the verdict calls junk.

gateTelemetry IDerivedWorkGateTelemetry

Counts what a junk verdict had to remove, without describing any of it.

retryPolicy OptimisticConcurrencyRetryPolicy

Commits the record from a fresh read when a concurrent write conflicts.

timeProvider TimeProvider

Stamps the evaluation time.

scanner ISpamScanner

Scores 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 scanner is null.