forked from External/greenlight
fix: health_check SMTP check when no auth required (#2281)
This commit is contained in:
parent
42bb568172
commit
97e961d580
|
@ -65,9 +65,13 @@ class HealthCheckController < ApplicationController
|
|||
smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto)
|
||||
end
|
||||
|
||||
if settings[:authentication].present? && settings[:authentication] != "none"
|
||||
smtp.start(settings[:domain]) do |s|
|
||||
s.authenticate(settings[:user_name], settings[:password], settings[:authentication])
|
||||
end
|
||||
else
|
||||
smtp.start(settings[:domain])
|
||||
end
|
||||
rescue => e
|
||||
raise "Unable to connect to SMTP Server - #{e}"
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue