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

[BUG] SMTP Validation may fail from Ruby 3.0 onwards #184

Closed
4 tasks done
esb opened this issue Nov 3, 2021 · 2 comments · Fixed by #186
Closed
4 tasks done

[BUG] SMTP Validation may fail from Ruby 3.0 onwards #184

esb opened this issue Nov 3, 2021 · 2 comments · Fixed by #186
Assignees
Labels
bug Something isn't working

Comments

@esb
Copy link

esb commented Nov 3, 2021

New bug checklist

[BUG] Ruby 3.0 changes the handling of SSL certificate verification which will cause failures when the certificate names don't match the IP addresses.

Bug description

The interface for the Net::SMTP start method changed in 3.0 to

start(address, port = nil, helo: 'localhost', user: nil, secret: nil, authtype: nil, tls_verify: true, tls_hostname: nil) { |smtp| ... }

The old method continues to be supported, but it looks like they changed to enable tls_verify by default. Under the 2.7 library, there's no problem connecting to gmail.com, but from 3.0 you get a connection error stating that there's a certificate error.

My feeling is that SSL errors are irrelevant for email verification, so tls_verify should always be off, and a quick way to fix this is to add the tls_verify: false option to the SMTP start method, although you would need to check the library version and only do this for versions 3.0+.

@esb esb added the bug Something isn't working label Nov 3, 2021
@bestwebua bestwebua changed the title SMTP Validation may fail from Ruby 3.0 onwards [BUG] SMTP Validation may fail from Ruby 3.0 onwards Nov 8, 2021
@bestwebua
Copy link
Member

Hello, @esb! Thanks for your bug report. I have tested this behaviour on Ruby 3.0.0 and I confirm this bug:
Screenshot 2021-11-08 at 12 01 33 PM

I'm going to fix this issue till the end of this week.

@bestwebua bestwebua linked a pull request Nov 8, 2021 that will close this issue
4 tasks
@bestwebua
Copy link
Member

@esb, this fix is available in latest (2.5.3) truemail release. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants