dmarc

package
v0.0.0-...-3aac958 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatFeedback

func FormatFeedback(feedback Feedback, color bool) string

func FormatHeader

func FormatHeader() string

func FormatStatus

func FormatStatus(status string, color bool) string

func GroupByOrgName

func GroupByOrgName(feedbacks []Feedback) map[string][]Feedback

func OrderByBeginTime

func OrderByBeginTime(feedbacks []Feedback)

Types

type AuthResults

type AuthResults struct {
	DKIM DKIMResult `xml:"dkim"`
	SPF  SPFResult  `xml:"spf"`
}

type DKIMResult

type DKIMResult struct {
	Domain string `xml:"domain"`
	Result string `xml:"result"`
}

type DateRange

type DateRange struct {
	Begin time.Time `xml:"begin"`
	End   time.Time `xml:"end"`
}

func (*DateRange) UnmarshalXML

func (d *DateRange) UnmarshalXML(dcr *xml.Decoder, start xml.StartElement) error

type Feedback

type Feedback struct {
	ReportMetadata  ReportMetadata  `xml:"report_metadata"`
	PolicyPublished PolicyPublished `xml:"policy_published"`
	Record          Record          `xml:"record"`
}

func DeduplicateFeedbacks

func DeduplicateFeedbacks(feedbacks []Feedback) []Feedback

func FilterFeedbacks

func FilterFeedbacks(feedbacks []Feedback, filter func(Feedback) bool) []Feedback

func MergeAdjacentFeedbacks

func MergeAdjacentFeedbacks(feedbacks []Feedback) []Feedback

func ParseDMARCReport

func ParseDMARCReport(filePath string) (Feedback, error)

func (Feedback) HasFailures

func (f Feedback) HasFailures() bool

type Identifiers

type Identifiers struct {
	HeaderFrom string `xml:"header_from"`
}

type PolicyEvaluated

type PolicyEvaluated struct {
	DKIM string `xml:"dkim"`
	SPF  string `xml:"spf"`
}

type PolicyPublished

type PolicyPublished struct {
	Domain string `xml:"domain"`
}

type Record

type Record struct {
	Row         Row         `xml:"row"`
	Identifiers Identifiers `xml:"identifiers"`
	AuthResults AuthResults `xml:"auth_results"`
}

type ReportMetadata

type ReportMetadata struct {
	OrgName   string    `xml:"org_name"`
	ReportID  string    `xml:"report_id"`
	DateRange DateRange `xml:"date_range"`
}

type Row

type Row struct {
	SourceIP        string          `xml:"source_ip"`
	PolicyEvaluated PolicyEvaluated `xml:"policy_evaluated"`
}

type SPFResult

type SPFResult struct {
	Domain string `xml:"domain"`
	Result string `xml:"result"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL