FEATURE: support DISCOURSE_SMTP_FORCE_TLS option (#11733)

Background: RFC 8314 3.3 asks that:

clients and servers SHOULD implement both STARTTLS on
port 587 and Implicit TLS on port 465

Discourse currently cannot be configured this way.
With this patch, it's possible to set
DISCOURSE_SMTP_FORCE_TLS=true to use implicit TLS on port 465
This commit is contained in:
godmar 2021-01-18 11:56:18 -05:00 committed by GitHub
parent 19b2011601
commit 9aeece465f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -92,6 +92,9 @@ smtp_enable_start_tls = true
# to disable, set to 'none'
smtp_openssl_verify_mode =
# force implicit TLS as per RFC 8314 3.3
smtp_force_tls = false
# load MiniProfiler in production, to be used by developers
load_mini_profiler = true

View File

@ -37,6 +37,10 @@ Discourse::Application.configure do
settings[:openssl_verify_mode] = GlobalSetting.smtp_openssl_verify_mode if GlobalSetting.smtp_openssl_verify_mode
if GlobalSetting.smtp_force_tls
settings[:tls] = true
end
config.action_mailer.smtp_settings = settings.reject { |_, y| y.nil? }
else
config.action_mailer.delivery_method = :sendmail