From 6641d858ad72cbf54d749d71ba5f48664420acbd Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Thu, 12 Mar 2020 21:46:21 +0000 Subject: [PATCH] courier: Extend TODO for DNS error handling on Go >= 1.13 In https://github.com/albertito/chasquid/issues/4, ludusrusso comments that the DNS lookup error handling in the SMTP courier could be improved by using DNSError.IsNotFound. That is true, but unfortunately it was only added in Go 1.13, and we are currently trying to support Go 1.11 since that's what in Debian stable. So this patch updates the TODO to note this, so that when we can use a newer Go version, we improve this code. --- internal/courier/smtp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/courier/smtp.go b/internal/courier/smtp.go index 7e16022..9f0cb74 100644 --- a/internal/courier/smtp.go +++ b/internal/courier/smtp.go @@ -260,7 +260,7 @@ func lookupMXs(tr *trace.Trace, domain string) ([]string, error) { // Unfortunately, go's API doesn't let us easily distinguish between // them. For now, if the error is permanent, we assume it's because // there was no MX and fall back, otherwise we return. - // TODO: Find a better way to do this. + // TODO: Use dnsErr.IsNotFound once we can use Go >= 1.13. dnsErr, ok := err.(*net.DNSError) if !ok { tr.Debugf("MX lookup error: %v", err)