mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
implement outgoing dmarc aggregate reporting
in smtpserver, we store dmarc evaluations (under the right conditions). in dmarcdb, we periodically (hourly) send dmarc reports if there are evaluations. for failed deliveries, we deliver the dsn quietly to a submailbox of the postmaster mailbox. this is on by default, but can be disabled in mox.conf.
This commit is contained in:
@ -192,9 +192,9 @@ Accounts:
|
||||
err = dmarcdb.Init()
|
||||
xcheckf(err, "dmarcdb init")
|
||||
report, err := dmarcrpt.ParseReport(strings.NewReader(dmarcReport))
|
||||
xcheckf(err, "parsing dmarc report")
|
||||
xcheckf(err, "parsing dmarc aggregate report")
|
||||
err = dmarcdb.AddReport(ctxbg, report, dns.Domain{ASCII: "mox.example"})
|
||||
xcheckf(err, "adding dmarc report")
|
||||
xcheckf(err, "adding dmarc aggregate report")
|
||||
|
||||
// Populate mtasts.db.
|
||||
err = mtastsdb.Init(false)
|
||||
@ -233,7 +233,8 @@ Accounts:
|
||||
const qmsg = "From: <test0@mox.example>\r\nTo: <other@remote.example>\r\nSubject: test\r\n\r\nthe message...\r\n"
|
||||
_, err = fmt.Fprint(mf, qmsg)
|
||||
xcheckf(err, "writing message")
|
||||
_, err = queue.Add(ctxbg, log, "test0", mailfrom, rcptto, false, false, int64(len(qmsg)), "<test@localhost>", prefix, mf, nil, nil)
|
||||
qm := queue.MakeMsg("test0", mailfrom, rcptto, false, false, int64(len(qmsg)), "<test@localhost>", prefix, nil)
|
||||
err = queue.Add(ctxbg, log, &qm, mf)
|
||||
xcheckf(err, "enqueue message")
|
||||
|
||||
// Create three accounts.
|
||||
|
Reference in New Issue
Block a user