Purple-Devs / health_check

Simple health check of Rails app for use with uptime checking sites like newrelic and pingdom
MIT License
476 stars 125 forks source link

SMTP check: enable_starttls => enable_starttls_auto ? #109

Open johanlunds opened 3 years ago

johanlunds commented 3 years ago

I think the code in the following block should be changed to:

smtp.enable_starttls_auto if settings[:enable_starttls_auto]

https://github.com/ianheggie/health_check/blob/6cd2f91b522b7d4af16386f5a2e8f76300a8d6a2/lib/health_check/utils.rb#L147-L153

Docs of Net::SMTP explains the difference:

https://www.rubydoc.info/stdlib/net/2.1.0/Net/SMTP

Image 2021-06-08 at 5 50 01 PM

And you can also compare to how the mail gem used by ActionMailer/Rails does it:

https://github.com/mikel/mail/blob/4f56234f04eb041810641ee0dfd717034a59b9dc/lib/mail/network/delivery_methods/smtp.rb#L112-L131