Table of Contents

Interface IAccountStoredContentLedger

Namespace
MailFathom.Application.EmailContent.Storage
Assembly
MailFathom.Application.dll

Answers how much stored mail content one account holds, without reading its mail to find out.

public interface IAccountStoredContentLedger

Remarks

A deployment-wide ceiling can ask the database what a table occupies, in constant time and without touching a row. A per-user ceiling has no such question available: a catalogue answers for a table and never for a share of one, and summing a mailbox's payload lengths would put a scan of a whole mailbox in front of every folder run. So the figure is maintained as it changes — one counter per account, moved inside the transaction that stores or removes the payload — and read here as a single row.

The counter is the account's rather than a user's because the mail is one copy however many users are assigned the mailbox. A user's figure is the sum over the accounts assigned to them, which is what ADR 0014 requires of a shared mailbox: it counts in full against every user assigned to it, and an assignment moves the figure without rewriting a row.

The figure is the payload bytes rather than what a disk fills with, which is what the deployment's ceiling counts. The two are deliberately different quantities, because only one of them is attributable to a mailbox at all, and nothing reconciles one against the other.

A maintained counter can drift where a payload leaves storage by a path nothing told it about, so the recomputation it was derived from stays available rather than being a one-off in a migration. That is what makes drift repairable instead of permanent, and it is the same statement the counter is asserted against.

Both members refuse an account naming nothing. Nothing gates this port — a synchronization run calls it directly — so the refusal is the port's own, and an implementation that answered such an account would be keeping a counter for "nothing" that reads exactly like a working figure.

Methods

ReadStoredContentBytesAsync(MailAccountId, CancellationToken)

Reads what one account's stored mail content occupies, from the maintained counter.

RederiveStoredContentBytesAsync(MailAccountId, CancellationToken)

Recomputes one account's figure from its stored payloads and adopts it.