Skip to content
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
Merged

Conversation

Gargron
Copy link
Member

@Gargron 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 added bug Something isn't working moderation Administration and moderation tooling testing Automated lint and test suites labels Dec 10, 2018
Copy link
Contributor

@renatolond renatolond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@Gargron Gargron merged commit dbb1ee2 into master Dec 10, 2018
@Gargron Gargron deleted the fix-email-mx-validator branch December 10, 2018 21:53
abcang pushed a commit to pixiv/mastodon that referenced this pull request Oct 1, 2019
hiyuki2578 pushed a commit to ProjectMyosotis/mastodon that referenced this pull request Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working moderation Administration and moderation tooling testing Automated lint and test suites
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants