mxbl = set(self.registryValue('mxbl'))
i = self.getIrc(irc)
- if (email in mxbl or
- email in i.domains):
+ if email.lower() in mxbl:
found = email
else:
- to_resolve = [(email,'A'), (email,'MX')]
+ to_resolve = [(email,'MX'), (email,'A'), (email,'AAAA')]
while to_resolve:
domain, type = to_resolve.pop(0)
try:
record = record.to_text()
if type == 'MX':
-- # these come out like '10 mx.example.com'
- record = record.split(" ", 1)[1]
+ record = record.split(" ", 1)[1].lower()
- to_resolve.append((record, 'A'))
+ # MX records (and their A records) are what we match on most,
+ # so doing .insert(0, ...) means they're checked first
+ to_resolve.insert(0, (record, 'A'))
+ to_resolve.insert(0, (record, 'AAAA'))
if record in mxbl:
found = record