Table of Contents

Method RecordAsync

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

RecordAsync(SpamClassification, SpamActionPosture, CancellationToken)

Asks for whatever the account's switches say should happen to one classified message.

public Task<SpamActionResult> RecordAsync(SpamClassification classification, SpamActionPosture posture, CancellationToken cancellationToken)

Parameters

classification SpamClassification

What classification concluded about the occurrence.

posture SpamActionPosture

Whether the changes are written down or only worked out.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<SpamActionResult>

The changes that were written down, what a dry run would have written down, or the reason there were none.

Remarks

The checks run in the order of what they cost and of what they settle. The verdict is already in hand and answers first, because it is free and refuses most messages; the occurrence is then read, because the switches are the account's and the occurrence is what names it; the threshold and the mailbox follow. A message nothing concluded junk about therefore costs no read at all, and one that is junk in a mailbox that asked for no action costs the occurrence row and nothing else.

The posture is read last of all, after every one of those checks. That is what makes a dry run a rehearsal rather than a prediction: a message a filing would be refused for reports the refusal in both postures, so an operator reading a dry run is reading the answers the acting run would reach and not a shorter list of them.

Exceptions

ArgumentNullException

Thrown when classification is null.

ArgumentOutOfRangeException

Thrown when posture is not a defined member.

PersistenceConcurrencyConflictException

Thrown when every allowed commit attempt conflicted.