truemail-rb / truemail

🚀 Configurable framework agnostic plain Ruby 📨 email validator/verifier. Verify email via Regex, DNS, SMTP and even more. Be sure that email address valid and exists.
https://truemail-rb.org/truemail-gem
MIT License
1.19k stars 60 forks source link

[BUG] Wrong domain punycode extraction #164

Closed bestwebua closed 3 years ago

bestwebua commented 3 years ago

This bug comes from #162, #163.

https://github.com/truemail-rb/truemail/blob/d8f4bee3586f35fb505b4c6a34e5f0cb049f117f/lib/truemail/validate/mx.rb#L57

Punycode email representation doesn't match to Truemail::RegexConstant::REGEX_EMAIL_PATTERN(because this regex matches UTF look, and not ASCII).

Call:

Truemail.validate('niña@mañana.com')

Exception:

ArgumentError: cannot interpret as DNS name: nil
bestwebua commented 3 years ago

Already fixed in latest (2.4.6) truemail release.