diff --git a/config/environments/production.rb b/config/environments/production.rb index b47d2ed8..771a6c69 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -101,6 +101,10 @@ Rails.application.configure do } end + # 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? + # Don't care if the mailer can't send. config.action_mailer.raise_delivery_errors = true diff --git a/sample.env b/sample.env index bf4f7249..129f8d80 100644 --- a/sample.env +++ b/sample.env @@ -121,6 +121,9 @@ GOOGLE_ANALYTICS_TRACKING_ID= # SMTP_AUTH=plain # SMTP_STARTTLS_AUTO=true # +# Comment this out to disable SMTP certificate verification. This option may pose a security risk. +# SMTP_OPENSSL_VERIFY_MODE=none +# SMTP_SERVER= SMTP_PORT= SMTP_DOMAIN=