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

'email_address' gem behaves inconsistently for MX validation #15056

Closed
nballenger opened this issue Aug 15, 2019 · 1 comment
Closed

'email_address' gem behaves inconsistently for MX validation #15056

nballenger opened this issue Aug 15, 2019 · 1 comment

Comments

@nballenger
Copy link

In f702e42, the email_address gem got added to do additional email validation. You may want to rethink using that library--it returns inconsistent validation results based on network status. If you have an outbound network failure or timeout during validation, it rejects the address as invalid based on the MX being absent or misconfigured, rather than raising a warning about being unable to request DNS records. It also behaves strangely once connectivity is restored, reporting valid domains as rejected because "This domain is not configured to accept email".

See the following issue for details/repro: afair/email_address#43

If you want to use the gem, you should probably turn off MX validation until that issue is resolved. It's on by default, so you would have to use:

EmailAddress::Config.configure(host_validation: :syntax)

somewhere in the code (currently that only happens in the specs).

@gonzaloriestra, @ethervoid

@gonzaloriestra
Copy link
Contributor

Hi @nballenger,

Thanks for reporting it. We added the MX validation to avoid syncing problems with Hubspot, which seems to have a similar validation. Also, we ensure it raises an error with typos like @gmali.com.

Maybe we could get rid of this validation by sending a confirmation email instead, but for now, I think it's not a big issue, because if the server loses connectivity, this would be the least of the troubles.

Anyway, we'll watch the gem to update it if they fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants