From eb34a2f9de5b8119e02ea63c9b32d20d04f0ab07 Mon Sep 17 00:00:00 2001 From: Florian Krauthan Date: Wed, 25 Mar 2026 04:21:08 -0700 Subject: [PATCH] Added option to skip TLS verification for mailer (#1291) --- .env.example | 1 + config/environments/production.rb | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 2928bcc1c..f5e98e7a4 100644 --- a/.env.example +++ b/.env.example @@ -74,6 +74,7 @@ SMTP_PORT=465 SMTP_USERNAME= SMTP_PASSWORD= SMTP_TLS_ENABLED=true +SMTP_TLS_SKIP_VERIFY=false # Address that emails are sent from EMAIL_SENDER= diff --git a/config/environments/production.rb b/config/environments/production.rb index 347a18617..f03508436 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -78,11 +78,12 @@ Rails.application.configure do config.action_mailer.default_url_options = { host: ENV["APP_DOMAIN"] } config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { - address: ENV["SMTP_ADDRESS"], - port: ENV["SMTP_PORT"], - user_name: ENV["SMTP_USERNAME"], - password: ENV["SMTP_PASSWORD"], - tls: ENV["SMTP_TLS_ENABLED"] == "true" + address: ENV["SMTP_ADDRESS"], + port: ENV["SMTP_PORT"], + user_name: ENV["SMTP_USERNAME"], + password: ENV["SMTP_PASSWORD"], + tls: ENV["SMTP_TLS_ENABLED"] == "true", + openssl_verify_mode: ENV["SMTP_TLS_SKIP_VERIFY"] == "true" ? OpenSSL::SSL::VERIFY_NONE : OpenSSL::SSL::VERIFY_PEER } # Ignore bad email addresses and do not raise email delivery errors.