New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve e-mail MX validator and add tests #9489

Merged
merged 1 commit into from Dec 10, 2018

Conversation

Projects
None yet
2 participants
@Gargron
Copy link
Member

Gargron commented Dec 10, 2018

The problem with the old validator code wasn't so much that it had a bug, but the usage was a bit misleading for admins. MX records are hostnames, so if you blacklisted an IP that a MX record pointed to, but not the MX hostname itself, it would still let accounts through.

Now the validator fetches MX records, and then A records for both the original domain as well as MX records, and then checks both the hostnames and the IPs against the blacklist, so if you have blacklisted either of them, no accounts would be let through.

A future improvement may be offering the admins a choice to automatically create blacklist records for the IPs when they enter a domain name.

@Gargron Gargron force-pushed the fix-email-mx-validator branch from 68674c9 to c6da869 Dec 10, 2018

@renatolond
Copy link
Collaborator

renatolond left a comment

Lgtm

@Gargron Gargron merged commit dbb1ee2 into master Dec 10, 2018

11 checks passed

ci/circleci: build Your tests passed on CircleCI!
Details
ci/circleci: check-i18n Your tests passed on CircleCI!
Details
ci/circleci: install Your tests passed on CircleCI!
Details
ci/circleci: install-ruby2.3 Your tests passed on CircleCI!
Details
ci/circleci: install-ruby2.4 Your tests passed on CircleCI!
Details
ci/circleci: install-ruby2.5 Your tests passed on CircleCI!
Details
ci/circleci: test-ruby2.3 Your tests passed on CircleCI!
Details
ci/circleci: test-ruby2.4 Your tests passed on CircleCI!
Details
ci/circleci: test-ruby2.5 Your tests passed on CircleCI!
Details
ci/circleci: test-webui Your tests passed on CircleCI!
Details
codeclimate All good!
Details

@Gargron Gargron deleted the fix-email-mx-validator branch Dec 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment