release: 1.7.0
test / test (push) Waiting to run

Receive DMARC aggregate reports on port 25 and show parsed summaries in the panel. Close Unreleased; pin compose and docs to 1.7.0.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 22:53:36 +03:00
parent c1ec4fbd79
commit 27aeadc71d
38 changed files with 1923 additions and 79 deletions
+35
View File
@@ -0,0 +1,35 @@
package postfix
import (
"strings"
"testing"
)
func TestRenderDMARCMaps(t *testing.T) {
recip, transport, relay, err := renderDMARCMaps(DMARCMapsConfig{
Recipients: []string{"dmarc-reports@mail.example.com"},
Domains: []string{"mail.example.com"},
})
if err != nil {
t.Fatal(err)
}
if !strings.Contains(string(recip), "dmarc-reports@mail.example.com OK") {
t.Fatalf("recipients:\n%s", recip)
}
if !strings.Contains(string(transport), "dmarc-ingest:") {
t.Fatalf("transport:\n%s", transport)
}
if !strings.Contains(string(relay), "mail.example.com OK") {
t.Fatalf("relay:\n%s", relay)
}
}
func TestRenderDMARCMapsEmpty(t *testing.T) {
recip, transport, relay, err := renderDMARCMaps(DMARCMapsConfig{})
if err != nil {
t.Fatal(err)
}
if len(recip)+len(transport)+len(relay) != 0 {
t.Fatalf("expected empty maps")
}
}