Domain Detective

API Reference

Class

DmarcAnalysis

Namespace DomainDetective
Assembly DomainDetective
Implements

To analyze DMARC records, you would need to follow the DMARC specification(RFC 7489). Here are some of the key points: 1. The DMARC record must start with "v=DMARC1". 2. The DMARC record should not have more than 255 characters. 3. The DMARC record should have a valid "p" tag, which is the policy tag.It can have three values: "none", "quarantine", or "reject". 4. The DMARC record can have an optional "rua" tag, which is the URI for aggregate reports. 5. The DMARC record can have an optional "ruf" tag, which is the URI for forensic reports. 6. The DMARC record can have an optional "pct" tag, which is the percentage of messages subjected to filtering.

Inheritance

  • Object
  • DmarcAnalysis

Remarks

DMARC TXT records are parsed and validated according to RFC 7489 with additional checks for common mistakes such as missing rua addresses. DMARCbis handling follows draft-ietf-dmarcbis-base: https://datatracker.ietf.org/doc/html/draft-ietf-dmarcbis-base

Usage

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by

Accepted by parameters

Constructors

Methods

public async Task AnalyzeDmarcRecords(IEnumerable<DnsAnswer> dnsResults, InternalLogger logger, String domainName = null, Func<String, String> getOrgDomain = null) #
Returns: Task

Analyzes dmarc records.

Parameters

dnsResults System.Collections.Generic.IEnumerable{DnsClientX.DnsAnswer} requiredposition: 0
logger DomainDetective.InternalLogger requiredposition: 1
domainName System.String = null optionalposition: 2
getOrgDomain System.Func{System.String,System.String} = null optionalposition: 3
public Void EvaluateAlignment(String fromDomain, String spfDomain, String dkimDomain, Func<String, String> getOrgDomain) #
Returns: Void

Evaluates SPF and DKIM alignment for the provided domains.

Parameters

fromDomain System.String requiredposition: 0
Domain from the RFC5322.From header.
spfDomain System.String requiredposition: 1
Domain authenticated via SPF.
dkimDomain System.String requiredposition: 2
Domain from the DKIM signature.
getOrgDomain System.Func{System.String,System.String} requiredposition: 3
Function returning the organisational domain for a given input.
public Void EvaluatePolicyStrength(Boolean checkSubdomainPolicy = false) #
Returns: Void

Flags DMARC policies set to none and suggests a stronger policy.

Parameters

checkSubdomainPolicy System.Boolean = false optionalposition: 0
Evaluates the sp tag when true.

Properties

public String Subject { get; set; } #

Gets or sets the subject value.

public Nullable<Int32> DnsRecordTtl { get; set; } #

DNS TTL (seconds) of the DMARC TXT record as returned by DNS.

public Nullable<Int32> CnameTtl { get; set; } #

TTL (seconds) of the CNAME record when this record was resolved via CNAME alias.

public Boolean IsCnameResolved { get; set; } #

True when the DMARC record was resolved through a CNAME alias.

public DnsConfiguration DnsConfiguration { get; set; } #

Gets or sets the dns configuration value.

public Func<String, DnsRecordType, Task<DnsAnswer[]>> QueryDnsOverride { get; set; } #

Represents the query dns override value.

public Dictionary<String, Boolean> ExternalReportAuthorization { get; set; } #

Gets or sets the external report authorization value.

public String DmarcRecord { get; set; } #

Gets or sets the dmarc record value.

public Boolean DmarcRecordExists { get; set; } #

Gets or sets the dmarc record exists value.

public Boolean MultipleRecords { get; set; } #

Gets or sets the multiple records value.

public Boolean StartsCorrectly { get; set; } #

Gets or sets the starts correctly value.

public Boolean ExceedsCharacterLimit { get; set; } #

Gets or sets the exceeds character limit value.

public Boolean HasMandatoryTags { get; set; } #

Gets or sets the has mandatory tags value.

public Boolean IsPolicyValid { get; set; } #

Gets or sets the is policy valid value.

public String Policy { get; } #

Represents the policy value.

public String SubPolicy { get; } #

Represents the sub policy value.

public String ReportingInterval { get; } #

Represents the reporting interval value.

public String Percent { get; } #

Represents the percent value.

public String SpfAlignment { get; } #

Represents the spf alignment value.

public String DkimAlignment { get; } #

Represents the dkim alignment value.

public String FailureReportingOptions { get; } #

Represents the failure reporting options value.

public String NonexistentPolicy { get; } #

Represents the nonexistent policy value.

public String PublicSuffixPolicy { get; } #

Represents the public suffix policy value.

public String ReportFeedback { get; } #

Represents the report feedback value.

public Boolean ValidDkimAlignment { get; set; } #

Gets or sets the valid dkim alignment value.

public Boolean ValidSpfAlignment { get; set; } #

Gets or sets the valid spf alignment value.

public Boolean WeakPolicy { get; set; } #

True when p=none or sp=none is detected.

public String PolicyRecommendation { get; set; } #

Recommendation message when a weak policy is found.

public String Advisory { get; set; } #

Summary message describing DMARC status.

public Boolean SpfAligned { get; set; } #

Indicates whether the SPF domain aligns with the policy.

public Boolean DkimAligned { get; set; } #

Indicates whether the DKIM domain aligns with the policy.

public Boolean InvalidReportUri { get; set; } #

Gets or sets the invalid report uri value.

public String Rua { get; set; } #

Gets or sets the rua value.

public List<String> MailtoRua { get; set; } #

Gets or sets the mailto rua value.

public List<String> HttpRua { get; set; } #

Gets or sets the http rua value.

public String Ruf { get; set; } #

Gets or sets the ruf value.

public List<String> MailtoRuf { get; set; } #

Gets or sets the mailto ruf value.

public List<String> HttpRuf { get; set; } #

Gets or sets the http ruf value.

public List<Nullable<Int64>> RufSizeLimits { get; set; } #

Gets or sets the ruf size limits value.

public List<String> UnknownTags { get; set; } #

Gets or sets the unknown tags value.

public List<String> DeprecatedTags { get; set; } #

Gets or sets the deprecated tags value.

public String SubPolicyShort { get; set; } #

Gets or sets the sub policy short value.

public String PolicyShort { get; set; } #

Gets or sets the policy short value.

public String FoShort { get; set; } #

Gets or sets the fo short value.

public String DkimAShort { get; set; } #

Gets or sets the dkim a short value.

public String SpfAShort { get; set; } #

Gets or sets the spf a short value.

public String NonexistentPolicyShort { get; set; } #

Gets or sets the nonexistent policy short value.

public String PublicSuffixPolicyShort { get; set; } #

Gets or sets the public suffix policy short value.

public String RfbShort { get; set; } #

Gets or sets the rfb short value.

public Nullable<Int32> Pct { get; set; } #

Gets or sets the pct value.

public Nullable<Int32> OriginalPct { get; set; } #

Gets or sets the original pct value.

public Boolean IsPctValid { get; set; } #

Gets or sets the is pct valid value.

public String ReportingIntervalShort { get; set; } #

Gets or sets the reporting interval short value.

public virtual List<Assessment> Assessments { get; } #

Structured assessments observed during DMARC analysis.

public IReadOnlyList<RecommendationAdvice> Recommendations { get; } #

Represents the recommendations value.

{{ include "footer" }}