File: dmarc.go

package info (click to toggle)
golang-github-emersion-go-msgauth 0.6.6-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 256 kB
  • sloc: makefile: 2
file content (50 lines) | stat: -rw-r--r-- 1,176 bytes parent folder | download
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"
}