]> khamidou — GitHub mirrors - flanker.git/commitdiff
If unable to connect to a MX server, don't cache that result.
authorJason E. Aten <j.e.aten@gmail.com>
Thu, 27 Nov 2014 02:03:29 +0000 (18:03 -0800)
committerRussell Jones <rjones@mailgunhq.com>
Mon, 12 Jan 2015 21:43:05 +0000 (13:43 -0800)
flanker/addresslib/validate.py

index a85e3cc5fe08780a15808258d90bb5aeebf28280..116ad1f616fbbef0c59b033f0736886132c65e5a 100644 (file)
@@ -138,7 +138,6 @@ def mail_exchanger_lookup(domain, metrics=False):
         mx_hosts = lookup_domain(domain)
         mtimes['dns_lookup'] += time.time() - bstart
         if mx_hosts is None:
-            mx_cache[domain] = False
             return None, mtimes
 
     # test connecting to the mx exchanger
@@ -146,7 +145,6 @@ def mail_exchanger_lookup(domain, metrics=False):
     mail_exchanger = connect_to_mail_exchanger(mx_hosts)
     mtimes['mx_conn'] = time.time() - bstart
     if mail_exchanger is None:
-        mx_cache[domain] = False
         return None, mtimes
 
     # valid mx records, connected to mail exchanger, return True