Table of Contents

Class MailRuleActionPlan

Namespace
MailFathom.Application.Rules.Actions
Assembly
MailFathom.Application.dll

What one email's matching rules together ask the mailbox for, in the order the changes are applied.

public sealed record MailRuleActionPlan : IEquatable<MailRuleActionPlan>
Inheritance
MailRuleActionPlan
Implements
Inherited Members

Remarks

One rule's actions are already proven compatible when the configuration is read; two rules matching one email are not, and cannot be — which rules match is a property of the message rather than of the set. Two rules filing one email into different folders is the case this resolves, and it resolves it the only way a rule set's own contract allows: the rules are folded in declared order, and an action the ones before it leave no room for is withheld rather than applied. Nothing here consults timing, so one email produces the same plan on every run and on every instance.

A withheld action is named by its rule so a run can say which rule did not get its way. Without that, a rule whose action was withheld reads exactly like a rule that never matched, which is the silence every part of this contract exists to avoid.

Properties

Actions

Gets the actions to apply, in the order MailFathom applies them.

IsEmpty

Gets whether the plan asks for no change at all.

Nothing

Gets the plan of an email whose rules ask for nothing.

WithheldActions

Gets the actions another rule had already settled, in the order they were reached.

WithheldRuleNames

Gets the names of the rules at least one of whose actions another rule had already settled.

Methods

Compose(IReadOnlyList<MailRule>)

Folds the actions of the rules that matched one email into the changes the mailbox will be asked for.