From ba0ec6ba71a12fa90a364f8ceea8132ee24e7acf Mon Sep 17 00:00:00 2001 From: zimmersi <74589100+zimmersi@users.noreply.github.com> Date: Tue, 2 Mar 2021 00:50:00 +0100 Subject: [PATCH] enable SMTPS: SMTP over direct TLS connection (#2485) * enable SMTPS: SMTP over direct TLS connection * remove gem 'sqlite3', '~> 1.3.6' as requested * enable SMTPS: SMTP over direct TLS connection * remove gem 'sqlite3', '~> 1.3.6' as requested * changed image name to kwgl * rebase and rubocop -a * removed gem 'sqlite3', '~> 1.3.6' --- config/environments/production.rb | 3 +++ sample.env | 3 +++ 2 files changed, 6 insertions(+) diff --git a/config/environments/production.rb b/config/environments/production.rb index f92ff48e..12e84b39 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -107,6 +107,9 @@ Rails.application.configure do } end + # enable SMTPS: SMTP over direct TLS connection + ActionMailer::Base.smtp_settings[:tls] = true if ENV['SMTP_TLS'].present? && ENV['SMTP_TLS'] != "false" + # If configured to 'none' don't check the smtp servers certificate ActionMailer::Base.smtp_settings[:openssl_verify_mode] = ENV['SMTP_OPENSSL_VERIFY_MODE'] if ENV['SMTP_OPENSSL_VERIFY_MODE'].present? diff --git a/sample.env b/sample.env index 12a76e03..2d62c0c7 100644 --- a/sample.env +++ b/sample.env @@ -135,6 +135,9 @@ GOOGLE_ANALYTICS_TRACKING_ID= # SMTP_AUTH=plain # SMTP_STARTTLS_AUTO=true # +# enable SMTPS: SMTP over direct TLS connection; usually port 465 +# SMTP_TLS=true +# # If your mail server has a self-signed certificate, you'll also need to include the line below. # Please note that enable this presents its own security risks and should not be done unless necessary. # SMTP_OPENSSL_VERIFY_MODE=none