Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthResults ¶
type AuthResults struct {
DKIM []DKIMResult `xml:"dkim,omitempty"`
SPF []SPFResult `xml:"spf"`
}
AuthResults contains authentication results
type DKIMResult ¶
type DKIMResult struct {
Domain string `xml:"domain"`
Selector string `xml:"selector,omitempty"`
Result string `xml:"result"` // none, pass, fail, policy, neutral, temperror, permerror
HumanResult string `xml:"human_result,omitempty"`
}
DKIMResult represents DKIM authentication result
type Feedback ¶
type Feedback struct {
XMLName xml.Name `xml:"feedback"`
Version string `xml:"version"`
ReportMetadata ReportMetadata `xml:"report_metadata"`
PolicyPublished PolicyPublished `xml:"policy_published"`
Records []Record `xml:"record"`
}
Feedback represents the root DMARC aggregate report structure (RFC 7489)
func ParseReport ¶
ParseReport parses a DMARC aggregate report from raw data
func (*Feedback) GetDMARCCompliantCount ¶
GetDMARCCompliantCount returns count of DMARC-compliant messages
func (*Feedback) GetDateRange ¶
GetDateRange returns the date range as time.Time objects
func (*Feedback) GetTotalMessages ¶
GetTotalMessages returns the total count of messages in the report
type Identifiers ¶
type Identifiers struct {
EnvelopeTo string `xml:"envelope_to,omitempty"`
EnvelopeFrom string `xml:"envelope_from,omitempty"`
HeaderFrom string `xml:"header_from"`
}
Identifiers contains message identifiers
type PolicyEvaluated ¶
type PolicyEvaluated struct {
Disposition string `xml:"disposition"` // none, quarantine, reject
DKIM string `xml:"dkim"` // pass, fail
SPF string `xml:"spf"` // pass, fail
Reason []Reason `xml:"reason,omitempty"`
}
PolicyEvaluated shows the result of policy evaluation
type PolicyPublished ¶
type PolicyPublished struct {
Domain string `xml:"domain"`
ADKIM string `xml:"adkim,omitempty"` // DKIM alignment mode (r=relaxed, s=strict)
ASPF string `xml:"aspf,omitempty"` // SPF alignment mode (r=relaxed, s=strict)
P string `xml:"p"` // Policy (none, quarantine, reject)
SP string `xml:"sp,omitempty"` // Subdomain policy
PCT int `xml:"pct,omitempty"` // Percentage of messages to filter
FO string `xml:"fo,omitempty"` // Failure reporting options
}
PolicyPublished represents the DMARC policy as published in DNS
type Record ¶
type Record struct {
Row Row `xml:"row"`
Identifiers Identifiers `xml:"identifiers"`
AuthResults AuthResults `xml:"auth_results"`
}
Record represents a single record in the aggregate report
type ReportMetadata ¶
type ReportMetadata struct {
OrgName string `xml:"org_name"`
Email string `xml:"email"`
ExtraContactInfo string `xml:"extra_contact_info,omitempty"`
ReportID string `xml:"report_id"`
DateRange DateRange `xml:"date_range"`
Errors []string `xml:"error,omitempty"`
}
ReportMetadata contains information about the report
type Row ¶
type Row struct {
SourceIP string `xml:"source_ip"`
Count int `xml:"count"`
PolicyEvaluated PolicyEvaluated `xml:"policy_evaluated"`
}
Row contains policy evaluation results