Table of Contents

Method Authenticated

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

Authenticated(IReadOnlyList<SenderDomain>, IReadOnlyList<SenderDomain>, SenderDomain?, DmarcOutcome)

Records the identities the receiving server verified.

public static SenderAuthentication Authenticated(IReadOnlyList<SenderDomain> dkimDomains, IReadOnlyList<SenderDomain> spfDomains, SenderDomain? fromDomain, DmarcOutcome dmarc)

Parameters

dkimDomains IReadOnlyList<SenderDomain>

Every domain whose DKIM signature verified, in the order the header reported them.

spfDomains IReadOnlyList<SenderDomain>

Every envelope-sender domain whose SPF check passed, in the same order.

fromDomain SenderDomain?

The domain the message displays as its sender, where it wrote a usable one.

dmarc DmarcOutcome

What the trusted header reported for DMARC.

Returns

SenderAuthentication

The verdict, naming the first DKIM domain as authoritative wherever one is present.

Remarks

Both collections rather than one domain apiece, because one passing signature must never hide another. A message legitimately carries a delivery provider's signature beside its author's, and taking whichever the server listed first would leave the author unestablished on ordinary mail while establishing nothing an attacker could not also arrange. Which one is kept as DkimDomain is evidence and stays first-in-header-order, because the displayed author decides no part of what the verdict records about the transport.

Exceptions

ArgumentNullException

Thrown when either collection is null.

ArgumentException

Thrown when neither check produced a domain, which is not an authenticated message.