Skip to content

Commit

Permalink
Merge pull request #72 from mailgun/cache_postives_only
Browse files Browse the repository at this point in the history
If unable to contact a host, don't cache that result.
  • Loading branch information
russjones committed Jan 12, 2015
2 parents a2d55ca + be90377 commit 73602f8
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions flanker/addresslib/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,13 @@ 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
bstart = time.time()
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
Expand Down

0 comments on commit 73602f8

Please sign in to comment.