Skip to content

A platform for community discussion. Free, open, simple.

FIX: Don't set smtp authentication type when there's no user or password

Daniel Waterworth897be75941eb
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 4d57a995857..5c3c41d2cda 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -31,12 +31,15 @@ Discourse::Application.configure do
domain: GlobalSetting.smtp_domain,
user_name: GlobalSetting.smtp_user_name,
password: GlobalSetting.smtp_password,
- authentication: GlobalSetting.smtp_authentication,
enable_starttls_auto: GlobalSetting.smtp_enable_start_tls,
open_timeout: GlobalSetting.smtp_open_timeout,
read_timeout: GlobalSetting.smtp_read_timeout,
}
+ if settings[:password] || settings[:user_name]
+ settings[:authentication] = GlobalSetting.smtp_authentication
+ end
+
settings[
:openssl_verify_mode
] = GlobalSetting.smtp_openssl_verify_mode if GlobalSetting.smtp_openssl_verify_mode