refactor sending dmarc reports for upcoming implementation for sending tls reports

this also has changes to make the dmarc report sending implementation more
similar to the tls reports implementation.

- factor out code to compose a dmarc report message to the message package
  (from dmarcdb for reports), it will be shared soon.
- spread emails with dmarc reports over 45 minutes (it runs hourly), with at
  most 5 mins in between reports. to prevent bursts of messages. properly abort
  all sending attempts at mox shutdown.
- add use of missing error details in an error path.
- fix dmarc report message subject header by adding missing <>'s around report-id.
- fix dmarc report attachment filename syntax by leaving "unique-id" out.
This commit is contained in:
Mechiel Lukkien
2023-11-09 17:26:19 +01:00
parent 2535f351ed
commit df18ca3c02
3 changed files with 263 additions and 192 deletions

View File

@ -276,7 +276,7 @@ func TestSendReports(t *testing.T) {
return <-step
}
sleepBetween = func() {}
sleepBetween = func(ctx context.Context, between time.Duration) (ok bool) { return true }
test := func(evals []Evaluation, expAggrAddrs map[string]struct{}, expErrorAddrs map[string]struct{}, optExpReport *dmarcrpt.Feedback) {
t.Helper()