Table of Contents

Method TryCreate

Namespace
MailFathom.Domain.Emails.Authentication
Assembly
MailFathom.Domain.dll

TryCreate(string?, out SenderDomain)

Builds a domain from what a header wrote.

public static bool TryCreate(string? candidate, out SenderDomain domain)

Parameters

candidate string

The domain text a header carried.

domain SenderDomain

The normalized domain, when the text is usable.

Returns

bool

true when the text is a domain this system will compare on; otherwise false.

Remarks

A malformed domain is refused rather than repaired, for the reason a malformed address is: guessing what an unparseable header meant would put a domain nobody wrote into a verdict a reader is later shown. What refusal costs is one identity of one message, which the not-established verdict already has a value for. A name whose A-labels no encoder can produce is refused the same way, and so is one whose ASCII form outgrows the bounds below, since it is that form a column has to hold.