Check SPF, DMARC, MTA-STS and DNS blocklists per sending domain; count delivery outcomes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
VeillaxandClaude Sonnet 5.5 committed 2026-10-27 16:56:57 -06:00
1 parent b46e0813fe
commit 3a86254cb6
6 files changed
+864

No files matched your search

+4
View File
@@ -344,6 +344,7 @@ func (s *mailSession) rcpt(m tunnel.MailMsg) {
}
if err := s.cl.Rcpt(m.To); err != nil {
e := asSMTPErr(err)
s.b.recordOutcome(s.pol.ID, s.domain, e.Code, e.Text)
if s.rcpts == 0 {
s.close()
}
@@ -398,6 +399,7 @@ func (s *mailSession) logEntry(size, code int, result, domain, mx string) {
if s.note != "" {
path += " · " + s.note
}
s.b.recordOutcome(s.pol.ID, domain, code, strings.TrimPrefix(result, "mail-failed: "))
s.b.logAccess(model.LogEntry{Time: s.start, Mapping: s.pol.ID, Remote: s.peer, Method: "MAIL", Host: domain, Path: path,
Status: code, Result: result, BytesIn: int64(size), Millis: time.Since(s.start).Milliseconds()})
}
@@ -429,6 +431,8 @@ func (b *Blacktip) mailCheck(pol model.MailPolicy) model.MailCheck {
if len(pol.DKIM) > 0 {
chk.DKIM = b.checkDKIM(pol.DKIM)
}
chk.Domains = b.checkDomains(pol)
chk.Blocklists, chk.Listable = b.checkBlocklists(pol.SourceIP)
probe := b.cfg.MailProbe
if probe == "" {
probe = defaultMailProbe