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

... otherwise net-smtp, starting with 0.5.0, complains.
This commit is contained in:
Daniel Waterworth 2024-03-27 13:41:49 -05:00
parent ccd493f23c
commit 897be75941
1 changed files with 4 additions and 1 deletions

View File

@ -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