Table of Contents

Class MailboxEmailSelection

Namespace
MailFathom.Application.Emails.Mailboxes
Assembly
MailFathom.Application.dll

Selects which stored emails a mailbox read returns, by everything except the order it reads them in.

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

Remarks

Every value here is already validated and already normalized, so the reader that turns it into a query decides nothing and no filter is normalized twice. Addresses arrive in the comparison form the persistence layer indexes, the scope is deduplicated and ordered, and a range that could select nothing was refused rather than passed on.

The structured predicate is its own type because two read models apply the same one: a timeline reads it in a keyset order and a lexical search reads it in relevance order. Restating these fields per read model would mean two implementations of the same validation and two SQL predicates that have to keep agreeing about what a recipient filter or an attachment filter means. What differs between the read models lives on the type that wraps this one — the reading direction on EmailTimelineFilter, the query text on a search.

Fields

MaximumAddressFilterLength

The greatest number of characters an address filter may carry.

MaximumSubjectFragmentLength

The greatest number of characters a subject fragment may carry.

Properties

CanonicalText

Gets the injective text of every field, which whatever wraps this selection identifies it by.

HasAttachments

Gets whether an email must carry attachments, or null when either matches.

IsRemotelySeen

Gets the remote \Seen state an email must have, or null when either matches.

ReceivedBefore

Gets the exclusive end of the received range, or null when the range has no end.

ReceivedOnOrAfter

Gets the inclusive start of the received range, or null when the range has no start.

RecipientNormalizedAddress

Gets the comparison form of the address a recipient must carry, or null when any recipient matches.

Scope

Gets the accounts and folders the read is restricted to.

SenderNormalizedAddress

Gets the comparison form of the address the sender must carry, or null when any sender matches.

SubjectFragment

Gets the fragment the subject must contain, compared without regard to case, or null when any subject matches.

Methods

Create(MailboxScope, string?, string?, string?, DateTimeOffset?, DateTimeOffset?, bool?, bool?)

Validates and normalizes the structured filters a request asked for.