Interface IMailRuleEvaluationStore
- Namespace
- MailFathom.Application.Rules.Evaluation
- Assembly
- MailFathom.Application.dll
The local state a rule pass reads its candidates from and records what it has evaluated into.
public interface IMailRuleEvaluationStore
Remarks
Every member here reads or writes what an earlier synchronization run already committed. Nothing on this port reaches
a mail server, which is what makes evaluation safe to run as a step beside synchronization rather than inside it: a
pass cannot open a mailbox session, and therefore cannot touch a remote \Seen flag however long it runs.
Both walks are keyset reads over one account, ordered by the stored email's identity, because that is the only ordering that is total, stable, and unaffected by anything a later write does to a row. The pass hands back the position it reached rather than the implementation remembering one, so a batch that stopped short of its own end resumes at the email nobody read.
Neither walk reaches a folder the account does not mirror. Mail such a folder stored before its synchronization was switched off is kept rather than erased, and a rule reading it would act on a mailbox MailFathom stopped observing: the flags are whatever they were on the day the switch was flipped, and nothing will ever correct them.
Methods
- GetEmailsAwaitingFirstEvaluationAsync(MailAccountId, StoredEmailId?, int, CancellationToken)
Reads the account's emails that no pass has evaluated, oldest identity first.
- GetStoredEmailsAsync(MailAccountId, StoredEmailId?, int, CancellationToken)
Reads the account's stored emails in identity order, whether or not a pass has evaluated them.
- ReadExtractedBodyTextAsync(StoredEmailId, CancellationToken)
Reads the text extracted from one email's body.
- RecordEvaluatedAsync(IPersistenceSession, IReadOnlyList<StoredEmailId>, DateTimeOffset, CancellationToken)
Records that a rule set has been evaluated for each of these emails.