Table of Contents

Class MailRuleHistoryRetention

Namespace
MailFathom.Application.Rules.History
Assembly
MailFathom.Application.dll

Ages the rule history out at the window the rule configuration declares.

public sealed class MailRuleHistoryRetention
Inheritance
MailRuleHistoryRetention
Inherited Members

Remarks

The history is the one part of the rule machinery that grows without an end of its own. A pass records what every rule it reached concluded about every message it evaluated, which is what makes "this rule has never matched" and "this rule was never asked" different answers — and it is also why a deployment left alone would accumulate a row per rule per message for as long as it runs. The window is the storage-limitation half of keeping that record at all.

It is the record's own bound and not the whole of its lifetime. An execution names a message, and a message erased anywhere in this system takes the executions naming it with it through the email's own deletion path — so the history inherits the deletion obligations of the mail it describes whatever this window says.

It runs on the account's own synchronization run rather than on a worker of its own, for the reason the two audit retentions do: an account already has a loop that comes round, and a second schedule would be a second thing to configure, watch, and reason about for work that is one bounded delete.

Constructors

MailRuleHistoryRetention(IMailRuleExecutionStore, MailRuleEvaluationOptions, TimeProvider)

Initializes the retention pass from the declared window and the history it erases from.

Fields

MaximumExecutionsErasedPerPass

The greatest number of executions one pass erases.

Methods

EraseExpiredAsync(MailAccountId, CancellationToken)

Erases everything in one account's history that has outlived the configured window.