mirror of
https://github.com/mjl-/mox.git
synced 2024-12-27 08:53:48 +03:00
in domain dnscheck, also check for hostname of mail server resolving to a loopback ip
nowadays the quickstart will warn about this, but it may be missed/ignored. and users that installed mox a few versions ago never got the warning. so now we keep warning about it in the dns check. based on feedback from Mendel on slack, thanks!
This commit is contained in:
parent
2e5376d7eb
commit
840f3afb35
1 changed files with 10 additions and 0 deletions
|
@ -536,6 +536,16 @@ func checkDomain(ctx context.Context, resolver dns.Resolver, dialer *net.Dialer,
|
||||||
}
|
}
|
||||||
r.IPRev.IPNames[ip] = addrs
|
r.IPRev.IPNames[ip] = addrs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Linux machines are often initially set up with a loopback IP for the hostname in
|
||||||
|
// /etc/hosts, presumably because it isn't known if their external IPs are static.
|
||||||
|
// For mail servers, they should certainly be static. The quickstart would also
|
||||||
|
// have warned about this, but could have been missed/ignored.
|
||||||
|
for _, ip := range ips {
|
||||||
|
if ip.IsLoopback() {
|
||||||
|
addf(&r.IPRev.Errors, "Hostname %s resolves to loopback IP %s, this will likely prevent email delivery to local accounts from working. The loopback IP was probably configured in /etc/hosts at system installation time. Replace the loopback IP with your actual external IPs in /etc/hosts.", mox.Conf.Static.HostnameDomain, ip.String())
|
||||||
|
}
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// MX
|
// MX
|
||||||
|
|
Loading…
Reference in a new issue