diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index d0054568d8..5b92311e4f 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -539,9 +539,9 @@ def test_email_configuration smtp_hash_new = { address: params[:address], enable_starttls_auto: params[:enable_starttls_auto] == '1', domain: params[:domain], - authentication: (params[:authentication].blank? ? nil : params[:authentication] ), - user_name: (params[:smtp_user_name].blank? ? nil : params[:smtp_user_name]), - password: (params[:smtp_password].blank? ? nil : params[:smtp_password]) } + authentication: params[:authentication].presence, + user_name: params[:smtp_user_name].presence, + password: params[:smtp_password].presence } smtp_hash_new[:port] = params[:port] if only_integer params[:port], 'port' ActionMailer::Base.smtp_settings = smtp_hash_new.compact raise_delivery_errors_setting = ActionMailer::Base.raise_delivery_errors