mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:14:40 +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:
14
serve.go
14
serve.go
@ -52,7 +52,7 @@ func shutdown(log *mlog.Log) {
|
||||
|
||||
// start initializes all packages, starts all listeners and the switchboard
|
||||
// goroutine, then returns.
|
||||
func start(mtastsdbRefresher, skipForkExec bool) error {
|
||||
func start(mtastsdbRefresher, sendDMARCReports, skipForkExec bool) error {
|
||||
smtpserver.Listen()
|
||||
imapserver.Listen()
|
||||
http.Listen()
|
||||
@ -69,10 +69,6 @@ func start(mtastsdbRefresher, skipForkExec bool) error {
|
||||
}
|
||||
}
|
||||
|
||||
if err := dmarcdb.Init(); err != nil {
|
||||
return fmt.Errorf("dmarc init: %s", err)
|
||||
}
|
||||
|
||||
if err := mtastsdb.Init(mtastsdbRefresher); err != nil {
|
||||
return fmt.Errorf("mtasts init: %s", err)
|
||||
}
|
||||
@ -86,6 +82,14 @@ func start(mtastsdbRefresher, skipForkExec bool) error {
|
||||
return fmt.Errorf("queue start: %s", err)
|
||||
}
|
||||
|
||||
// dmarcdb starts after queue because it may start sending reports through the queue.
|
||||
if err := dmarcdb.Init(); err != nil {
|
||||
return fmt.Errorf("dmarc init: %s", err)
|
||||
}
|
||||
if sendDMARCReports {
|
||||
dmarcdb.Start(dns.StrictResolver{Pkg: "dmarcdb"})
|
||||
}
|
||||
|
||||
store.StartAuthCache()
|
||||
smtpserver.Serve()
|
||||
imapserver.Serve()
|
||||
|
Reference in New Issue
Block a user