When resolving MX records, we need to distinguish between "no such domain" and other kinds of errors. Before Go 1.13, this was not possible, so we had a workaround that assumed any permanent error was a "no such domain", which is not great, but functional. Now that our minimum supported version is Go 1.15, we can remove the workaround. This patch replaces the workaround with proper logic using DNSError.IsNotFound to identify NXDOMAIN results when resolving MX records. This requires to adjust a few tests, that used to work on environments where resolving unknown domains (used for testing) returned a permanent error, and now they no longer do so. Instead of relying on this environmental property, we make the affected tests use our own DNS server, which should make them more hermetic and reproducible.
180 B
180 B