about summary refs log tree commit diff
path: root/config/environments/production.rb
diff options
context:
space:
mode:
authortkr <account@kgtkr.net>2022-01-13 20:05:22 +0900
committerGitHub <noreply@github.com>2022-01-13 12:05:22 +0100
commitb52fdb4c6f28b6f09861f1bc856079bb60391055 (patch)
tree9dbd0952a3e86e4cd0c6efb752d673ffd866686c /config/environments/production.rb
parentea61d3acd6a416471f3fc5ca5e4ee5da0bf01612 (diff)
Fix SMTP_ENABLE_STARTTLS_AUTO/SMTP_TLS/SMTP_SSL environment variables don't work (#17216)
#17215
Diffstat (limited to 'config/environments/production.rb')
-rw-r--r--config/environments/production.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 4a8899944..7e58c2b1c 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -107,9 +107,9 @@ Rails.application.configure do
     :authentication       => ENV['SMTP_AUTH_METHOD'] == 'none' ? nil : ENV['SMTP_AUTH_METHOD'] || :plain,
     :ca_file              => ENV['SMTP_CA_FILE'].presence || '/etc/ssl/certs/ca-certificates.crt',
     :openssl_verify_mode  => ENV['SMTP_OPENSSL_VERIFY_MODE'],
-    :enable_starttls_auto => ENV['SMTP_ENABLE_STARTTLS_AUTO'] || true,
-    :tls                  => ENV['SMTP_TLS'].presence,
-    :ssl                  => ENV['SMTP_SSL'].presence,
+    :enable_starttls_auto => ENV['SMTP_ENABLE_STARTTLS_AUTO'] != 'false',
+    :tls                  => ENV['SMTP_TLS'].presence && ENV['SMTP_TLS'] == 'true',
+    :ssl                  => ENV['SMTP_SSL'].presence && ENV['SMTP_SSL'] == 'true',
   }
 
   config.action_mailer.delivery_method = ENV.fetch('SMTP_DELIVERY_METHOD', 'smtp').to_sym