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.