Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
config: fix smtp setup
Browse files Browse the repository at this point in the history
Fixes #668

Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
  • Loading branch information
mssola committed Jan 21, 2016
1 parent a0ed6d6 commit 296dabe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 0 additions & 5 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify

# By default it picks sendmail as the delivery method. Note that the
# `config/initializers/smtp.rb` file will change that in case SMTP was set by
# the config file.
config.action_mailer.delivery_method = :sendmail

# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new

Expand Down
5 changes: 0 additions & 5 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify

# By default it picks sendmail as the delivery method. Note that the
# `config/initializers/smtp.rb` file will change that in case SMTP was set by
# the config file.
config.action_mailer.delivery_method = :sendmail

# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new

Expand Down
4 changes: 4 additions & 0 deletions config/initializers/smtp.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# If SMTP was set, then use it as the delivery method and configure it with the
# given config.

if defined?(APP_CONFIG) && APP_CONFIG["email"]["smtp"]["enabled"]
Portus::Application.config.action_mailer.delivery_method = :smtp

Expand All @@ -13,4 +14,7 @@
authentication: :login,
enable_starttls_auto: true
}
else
# If SMTP is not enabled, then go for sendmail.
Portus::Application.config.action_mailer.delivery_method = :sendmail
end

0 comments on commit 296dabe

Please sign in to comment.