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
candidatestringThe domain text a header carried.
domainSenderDomainThe normalized domain, when the text is usable.
Returns
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.