7 "github.com/mjl-/mox/dns"
10func TestReceived(t *testing.T) {
11 test := func(r Received, exp string) {
15 t.Fatalf("got %q, expected %q", s, exp)
22 ClientIP: net.ParseIP("0.0.0.0"),
24 Helo: dns.IPDomain{Domain: dns.Domain{ASCII: "y"}},
27 Identity: ReceivedMailFrom,
28 Mechanism: "+ip4:0.0.0.0/0",
29 }, "Received-SPF: pass (c) client-ip=0.0.0.0; envelope-from=\"x@x\"; helo=y;\r\n\tproblem=\"a b\\\"\\\\\"; mechanism=\"+ip4:0.0.0.0/0\"; receiver=z; identity=mailfrom\r\n")
33 ClientIP: net.ParseIP("0.0.0.0"),
35 Helo: dns.IPDomain{IP: net.ParseIP("2001:db8::1")},
37 Identity: ReceivedMailFrom,
38 }, "Received-SPF: pass client-ip=0.0.0.0; envelope-from=\"x@x\"; helo=\"2001:db8::1\";\r\n\treceiver=z; identity=mailfrom\r\n")