Table of Contents

Class SpamClassificationPass

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

Carries an account's whole-mailbox classification run as far as one pass's batch budget reaches.

public sealed class SpamClassificationPass
Inheritance
SpamClassificationPass
Inherited Members

Remarks

A step of the account's synchronization run rather than a schedule of its own, exactly as rule evaluation is. That run already has per-account isolation, a jittered backoff, a slot count that stops one account starving another, and a failure path that defers the account instead of the process; a classification walk needs every one of those and none of them differently. It follows that only one pass per account is ever in flight, structurally rather than by a lock — which is the other half of what makes one outstanding run per account mean one walk of one mailbox.

It reaches no mail server for the mail it reads. Every message it scores was committed by an earlier run and is read through the local content store, so the MCP-reads-are-local invariant and the remote \Seen flag are both untouched however long a walk takes. What it can reach the network for is a scanner sidecar, which is a call the adapter bounds, and — where the run acts and a filing has to find its folder — the destination resolution every author of a mutation goes through.

The run's terms are read from the run rather than from configuration. A walk that spans hours must mean the same thing at its end as at its start, so the scope, the posture, and whether it rescores are what the operator asked for and not what the file says now. What configuration is still read for is the profile, and a profile that has moved ends the run rather than being applied to the half of the mailbox that is left.

Each batch commits the position it reached, so a restart resumes at the message nobody scored. The classification of one message is committed by the use case that reaches it rather than in the batch's own transaction, which is a deliberate difference from the rule pass and costs exactly one thing: a crash inside a batch re-reaches that batch's messages, whose records are upserts of the same verdict and whose mutation requests are refused as already asked for, so nothing is duplicated in the database or on the mail server and only the run's own counts can double-count what the lost attempt did.

Constructors

SpamClassificationPass(ISpamClassificationRunStore, IClassifiableEmailReader, IEmailSpamClassificationStore, EmailSpamClassifier, SpamActionRecorder, ISpamClassificationSettingsReader, OptimisticConcurrencyRetryPolicy, SpamClassificationRunOptions, TimeProvider)

Initializes the pass from the run it carries and the local state it walks.

Methods

RunAsync(MailAccountId, CancellationToken)

Takes one bounded pass over the account's requested run, where it has one.