spam_email icon indicating copy to clipboard operation
spam_email copied to clipboard

Add dns lookup to check for email domain aliases.

Open motionless opened this issue 3 years ago • 1 comments

This should help to make the blacklist more valuable.

Context: Trash mailers provide email aliases that are mapped to a different domain. Using resolv to get to the original MX record helps to catch more email addresses that coming from trash mailer.

motionless avatar Mar 24 '21 11:03 motionless

Hi and thank you for your contribution. We haven't implemented DNS lookup so far because of speed loss and the big amount of queries. I have some questions:

  • What happens if the record lookup times out?
  • What's the default timeout?
  • Why is the record lookup performed always, not only if the domain is not found in the blacklist?
  • Is it possible to somehow cache the record lookups?
  • You shouldn't just take the first MX record, but the one with lowest preference value
  • You should also apply .downcase to the MX domain
  • It's more likely the main_domain is in the blacklist than the complete_domain. That's why we had the checks in that order. Is there a reason why you changed the order?

cbhp avatar Mar 29 '21 14:03 cbhp