Browse Source

Fix SMTP config regression when not using authentication

`user_name` and `password` need to be set to nil when no authentication should be performed

Fixes #1657
Dominik Sander 8 years ago
parent
commit
7e43e07736
1 changed files with 2 additions and 2 deletions
  1. 2 2
      config/initializers/action_mailer.rb

+ 2 - 2
config/initializers/action_mailer.rb

@@ -4,8 +4,8 @@ ActionMailer::Base.smtp_settings = {
   domain: ENV['SMTP_DOMAIN'],
   authentication: ENV['SMTP_AUTHENTICATION'] || "plain",
   enable_starttls_auto: ENV['SMTP_ENABLE_STARTTLS_AUTO'] == 'true',
-  user_name: ENV['SMTP_USER_NAME'] || "",
-  password: ENV['SMTP_PASSWORD'] || "",
+  user_name: ENV['SMTP_USER_NAME'].presence,
+  password: ENV['SMTP_PASSWORD'].presence,
   openssl_verify_mode: ENV['SMTP_OPENSSL_VERIFY_MODE'].presence,
   ca_path: ENV['SMTP_OPENSSL_CA_PATH'].presence,
   ca_file: ENV['SMTP_OPENSSL_CA_FILE'].presence