mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-21 12:51:53 +00:00
check A RR records when no MX RR record could be found
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2461 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
28d3b45819
commit
8e720030d1
1 changed files with 15 additions and 7 deletions
|
|
@ -153,13 +153,21 @@ class MailtoUrl (urlbase.UrlBase):
|
|||
if len(answers) == 0:
|
||||
self.add_warning(_("No MX mail host for %(domain)s found.") % \
|
||||
{'domain': domain})
|
||||
return
|
||||
# sort according to preference (lower preference means this
|
||||
# host should be preferred
|
||||
mxdata = [(rdata.preference,
|
||||
rdata.exchange.to_text(omit_final_dot=True))
|
||||
for rdata in answers]
|
||||
mxdata.sort()
|
||||
answers = linkcheck.dns.resolver.query(domain, 'A')
|
||||
if len(answers) == 0:
|
||||
self.set_result(_("No host for %(domain)s found.") % \
|
||||
{'domain': domain}, valid=False)
|
||||
return
|
||||
# set preference to zero
|
||||
mxdata = [(0, rdata.to_text(omit_final_dot=True))
|
||||
for rdata in answers]
|
||||
else:
|
||||
mxdata = [(rdata.preference,
|
||||
rdata.exchange.to_text(omit_final_dot=True))
|
||||
for rdata in answers]
|
||||
# sort according to preference (lower preference means this
|
||||
# host should be preferred)
|
||||
mxdata.sort()
|
||||
# debug output
|
||||
linkcheck.log.debug(linkcheck.LOG_CHECK,
|
||||
"found %d MX mailhosts:", len(answers))
|
||||
|
|
|
|||
Loading…
Reference in a new issue