-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathdmarc.go
50 lines (40 loc) · 1.15 KB
/
dmarc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Package dmarc implements DMARC as specified in RFC 7489.
package dmarc
import (
"time"
)
type AlignmentMode string
const (
AlignmentStrict AlignmentMode = "s"
AlignmentRelaxed = "r"
)
type FailureOptions int
const (
FailureAll FailureOptions = 1 << iota // "0"
FailureAny // "1"
FailureDKIM // "d"
FailureSPF // "s"
)
type Policy string
const (
PolicyNone Policy = "none"
PolicyQuarantine = "quarantine"
PolicyReject = "reject"
)
type ReportFormat string
const (
ReportFormatAFRF ReportFormat = "afrf"
)
// Record is a DMARC record, as defined in RFC 7489 section 6.3.
type Record struct {
DKIMAlignment AlignmentMode // "adkim"
SPFAlignment AlignmentMode // "aspf"
FailureOptions FailureOptions // "fo"
Policy Policy // "p"
Percent *int // "pct"
ReportFormat []ReportFormat // "rf"
ReportInterval time.Duration // "ri"
ReportURIAggregate []string // "rua"
ReportURIFailure []string // "ruf"
SubdomainPolicy Policy // "sp"
}