Table of Contents

Class EmailSpamClassifier

Namespace
MailFathom.Application.Spam
Assembly
MailFathom.Application.dll

Classifies one stored occurrence and records what it concluded.

public sealed class EmailSpamClassifier
Inheritance
EmailSpamClassifier
Inherited Members

Remarks

The operation is keyed to the occurrence and is idempotent: repeating it either leaves an existing record alone or replaces it with the same verdict the same inputs produce, so it is safe for a caller to retry and safe for two callers to ask together. It carries no scheduler, no retry policy of its own, and no execution identity — whatever asks for a classification owns those.

It reaches no mail server. Content comes from the local store, which already holds it, so classification never triggers an IMAP fetch and cannot affect a remote \Seen flag. It writes no folder, no flag, and nothing about where the message lives.

It writes one thing besides the classification, and only when the verdict is spam: the passages cut from the message and the vectors hanging off them are removed. Ordering classification ahead of chunking and embedding is what stops them being created for junk in the first place, so this reaches only mail that was chunked and embedded before anybody scored it — the case an on-demand run over an existing mailbox produces and the arrival path never does.

Nothing it reads is loggable. The occurrence identifier, the folder alias, the outcome, and the verdict are safe to report; a header value, an authentication detail, and a subject are not, and none of the three reaches a log line from here.

Constructors

EmailSpamClassifier(IClassifiableEmailReader, IEmailContentStore, IEmailSpamHeaderReader, IJunkMailFolderCatalog, DeterministicSpamClassifier, ISpamClassificationSettingsReader, IEmailSpamClassificationStore, IEmailChunkStore, IDerivedWorkGateTelemetry, OptimisticConcurrencyRetryPolicy, TimeProvider, ISpamScanner?)

Initializes the use case.

Methods

ClassifyAsync(StoredEmailId, SpamClassificationMode, CancellationToken)

Classifies one occurrence.