Skip to content
Snippets Groups Projects
Commit 7785289f authored by ale's avatar ale
Browse files

Export policy_evaluated fields of DMARC records

These are useful to spot failures.

Also, run tests before building the container image.
parent 1643ea7b
Branches
No related tags found
No related merge requests found
include: "https://git.autistici.org/ai3/build-container/raw/master/common.yml"
stages:
- test
- build
- release
run_tests:
stage: test
image: registry.git.autistici.org/ai3/docker/test/golang:master
script:
- run-go-test .
artifacts:
when: always
reports:
cobertura: cover.xml
junit: report.xml
......@@ -320,9 +320,6 @@ func TestDMARC_Emails(t *testing.T) {
t.Errorf("error parsing %s: %v", testf, err)
continue
}
if sink.counter == 0 {
t.Errorf("nothing parsed from %s", testf)
}
}
}
......
......@@ -153,6 +153,9 @@ func (h *DMARCHandler) eventFromRecord(report *dmarcReport, rec *dmarcRecord) Ev
e.Set("report_id", report.Metadata.ReportID)
e.Set("report_organization", report.Metadata.Organization)
e.Set("policy_evaluated_disposition", rec.Row.PolicyEvaluated.Disposition)
e.Set("policy_evaluated_dkim", rec.Row.PolicyEvaluated.DKIM)
e.Set("policy_evaluated_spf", rec.Row.PolicyEvaluated.SPF)
e.Set("dmarc_envelope_from", rec.Identifiers.EnvelopeFrom)
e.Set("dmarc_header_from", rec.Identifiers.HeaderFrom)
e.Set("dmarc_dkim", rec.AuthResults.DKIM.Result)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment