Documentation
¶
Overview ¶
Package dmarc provides types for building a DMARC DNS TXT record.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlignmentPolicy ¶
type AlignmentPolicy string
AlignmentPolicy represents a DMARC alignment policy (strict, relaxed).
const ( AlignmentPolicyStrict AlignmentPolicy = "s" AlignmentPolicyRelaxed AlignmentPolicy = "r" )
DMARC identifier alignment modes, per RFC 7489 section 6.3.
type Policy ¶
type Policy string
Policy represents a DMARC policy (none, quarantine, reject).
const ( PolicyNone Policy = "none" PolicyQuarantine Policy = "quarantine" PolicyReject Policy = "reject" )
DMARC policies, per RFC 7489 section 6.3.
type Record ¶
type Record struct {
Version string `mapstructure:"version"`
Policy Policy `mapstructure:"policy"`
Percent *uint8 `mapstructure:"percent"`
ReportURIAggregate []string `mapstructure:"report-uri-aggregate"`
ReportURIFailure []string `mapstructure:"report-uri-failure"`
SubdomainPolicy Policy `mapstructure:"subdomain-policy"`
AlignmentPolicyDKIM AlignmentPolicy `mapstructure:"alignment-policy-dkim"`
AlignmentPolicySPF AlignmentPolicy `mapstructure:"alignment-policy-spf"`
}
Record represents a DMARC DNS record.
func (*Record) RecordPrefix ¶
RecordPrefix returns the DNS owner label prefix for a DMARC record, always "_dmarc.".
func (*Record) RecordType ¶
RecordType returns the DNS record type string, "TXT".
func (*Record) RecordValue ¶
RecordValue returns the wire-ready, quoted DMARC record value.
func (*Record) Render ¶
Render expands the Go template strings in ReportURIAggregate and ReportURIFailure against data.
func (*Record) SetPercent ¶
SetPercent sets Percent to pct, returning an error if pct exceeds 100.
func (*Record) UnsetPercent ¶
func (r *Record) UnsetPercent()
UnsetPercent clears Percent, omitting "pct=" from the rendered record.