summaryrefslogtreecommitdiffstats
path: root/config/environments
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2017-04-17 18:41:19 +1000
committerEugen <eugen@zeonfederated.com>2017-04-17 10:41:19 +0200
commite9eaf9e33c826bed107785b2d3291750dc21e14c (patch)
tree6ffc6bb9ec16095c985f8e89eceac38503b77559 /config/environments
parente22f9819bba5bbbca503a7ffddc29b681cf76344 (diff)
Allow using an SMTP server without authentication (#1597)
* Allow using an SMTP server without authentication (e.g Postfix relay on the same host) by setting SMTP_LOGIN and SMTP_AUTH_METHOD to 'none' * Add note in .env.production.sample about SMTP settings for servers where no auth is required * Assume that SMTP_LOGIN and SMTP_PASSWORD will be blank if we set SMTP_AUTH_METHOD to none
Diffstat (limited to 'config/environments')
-rw-r--r--config/environments/production.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb
index 80021287a52..a4cdb273232 100644
--- a/config/environments/production.rb
+++ b/config/environments/production.rb
@@ -100,8 +100,10 @@ Rails.application.configure do
:address => ENV['SMTP_SERVER'],
:user_name => ENV['SMTP_LOGIN'],
:password => ENV['SMTP_PASSWORD'],
+
:domain => ENV['SMTP_DOMAIN'] || ENV['LOCAL_DOMAIN'],
- :authentication => ENV['SMTP_AUTH_METHOD'] || :plain,
+ :authentication => ENV['SMTP_AUTH_METHOD'] == 'none' ? nil : ENV['SMTP_AUTH_METHOD'] || :plain,
+
:openssl_verify_mode => ENV['SMTP_OPENSSL_VERIFY_MODE'],
:enable_starttls_auto => ENV['SMTP_ENABLE_STARTTLS_AUTO'] || true,
}