Table of Contents

Method ClassifyAsync

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

ClassifyAsync(StoredEmailId, SpamClassificationMode, CancellationToken)

Classifies one occurrence.

public Task<SpamClassificationResult> ClassifyAsync(StoredEmailId emailId, SpamClassificationMode mode, CancellationToken cancellationToken)

Parameters

emailId StoredEmailId

The occurrence to classify.

mode SpamClassificationMode

What to do about an occurrence that already carries a classification.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<SpamClassificationResult>

What was recorded, or the reason nothing was.

Remarks

The order of the checks is the order of what they cost. Whether classification is on at all is free, the scope and the existing record are one lookup each, and only then is content read — so an occurrence outside the scope costs no read of its mail, which is the property that keeps a switched-off feature free.

Exceptions

ArgumentOutOfRangeException

Thrown when mode is not a defined member.

PersistenceConcurrencyConflictException

Thrown when every allowed commit attempt conflicted.