mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 13:04:38 +03:00
add strict mode when parsing messages, typically enabled for incoming special-use messages like tls/dmarc reports, subjectpass emails
and pass a logger to the message parser, so problems with message parsing get the cid logged.
This commit is contained in:
@ -19,6 +19,8 @@ import (
|
||||
"github.com/mjl-/mox/smtp"
|
||||
)
|
||||
|
||||
var xlog = mlog.New("dsn")
|
||||
|
||||
func xparseDomain(s string) dns.Domain {
|
||||
d, err := dns.ParseDomain(s)
|
||||
if err != nil {
|
||||
@ -33,7 +35,7 @@ func xparseIPDomain(s string) dns.IPDomain {
|
||||
|
||||
func tparseMessage(t *testing.T, data []byte, nparts int) (*Message, *message.Part) {
|
||||
t.Helper()
|
||||
m, p, err := Parse(bytes.NewReader(data))
|
||||
m, p, err := Parse(xlog, bytes.NewReader(data))
|
||||
if err != nil {
|
||||
t.Fatalf("parsing dsn: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user