Skip to content
Snippets Groups Projects
Unverified Commit bf04743b authored by Christian Marg's avatar Christian Marg Committed by GitHub
Browse files

allow for mail system without authentication (#1019)

* allow for mail system without authentication

* try to fix travis build
parent 7fa7d2f5
Branches
No related tags found
No related merge requests found
......@@ -82,7 +82,8 @@ Rails.application.configure do
# Tell Action Mailer to use smtp server, if configured
config.action_mailer.delivery_method = ENV['SMTP_SERVER'].present? ? :smtp : :sendmail
ActionMailer::Base.smtp_settings = {
ActionMailer::Base.smtp_settings = if ENV['SMTP_AUTH'].present? && ENV['SMTP_AUTH'] != "none"
{
address: ENV['SMTP_SERVER'],
port: ENV["SMTP_PORT"],
domain: ENV['SMTP_DOMAIN'],
......@@ -91,6 +92,14 @@ Rails.application.configure do
authentication: ENV['SMTP_AUTH'],
enable_starttls_auto: ENV['SMTP_STARTTLS_AUTO'],
}
else
{
address: ENV['SMTP_SERVER'],
port: ENV["SMTP_PORT"],
domain: ENV['SMTP_DOMAIN'],
enable_starttls_auto: ENV['SMTP_STARTTLS_AUTO'],
}
end
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment