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