Skip to content

Commit

Permalink
admin check: do not raise error when forward-confirmed reverse dns do…
Browse files Browse the repository at this point in the history
…es not match hostname

this should be relatively common with setups involving NAT.
so we do warn about it when NAT isn't active since it could highlight potential
misconfiguration.

for issue #239 by exander77
  • Loading branch information
mjl- committed Jan 23, 2025
1 parent 3c77e07 commit acc1c13
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webadmin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ EOF
continue
}
if len(addrs) != 1 {
addf(&r.IPRev.Errors, "Expected exactly 1 name for %s of %s, got %d (%v)", ip, host, len(addrs), addrs)
addf(&r.IPRev.Warnings, "Expected exactly 1 name for %s of %s, got %d (%v)", ip, host, len(addrs), addrs)
}
var match bool
for i, a := range addrs {
Expand All @@ -679,8 +679,8 @@ EOF
match = true
}
}
if !match {
addf(&r.IPRev.Errors, "Reverse name(s) %s for ip %s do not match hostname %s, which will cause other mail servers to reject incoming messages from this IP.", strings.Join(addrs, ","), ip, host)
if !match && !isNAT && host == mox.Conf.Static.HostnameDomain {
addf(&r.IPRev.Warnings, "IP %s with name(s) %s is forward confirmed, but does not match hostname %s.", ip, strings.Join(addrs, ","), host)
}
r.IPRev.IPNames[ip] = addrs
}
Expand Down

0 comments on commit acc1c13

Please sign in to comment.