diff --git a/app/controllers/health_check_controller.rb b/app/controllers/health_check_controller.rb index c5f5d66f..0c2fbb2d 100644 --- a/app/controllers/health_check_controller.rb +++ b/app/controllers/health_check_controller.rb @@ -65,8 +65,12 @@ class HealthCheckController < ApplicationController smtp.enable_starttls_auto if smtp.respond_to?(:enable_starttls_auto) end - smtp.start(settings[:domain]) do |s| - s.authenticate(settings[:user_name], settings[:password], settings[:authentication]) + 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}"