847abca122
Move everything to initializers, and replace the email settings interceptor by a BalancerDeliveryMethod. It has the advantage that it can be configured entirely from the `config/environment.rb` file, without an extra file to look at.
17 lines
449 B
Ruby
17 lines
449 B
Ruby
if ENV['HELO_ENABLED'] == 'enabled'
|
|
ActiveSupport.on_load(:action_mailer) do
|
|
module Helo
|
|
class SMTP < ::Mail::SMTP; end
|
|
end
|
|
|
|
ActionMailer::Base.add_delivery_method :helo, Helo::SMTP
|
|
ActionMailer::Base.helo_settings = {
|
|
user_name: 'demarches-simplifiees',
|
|
password: '',
|
|
address: '127.0.0.1',
|
|
domain: '127.0.0.1',
|
|
port: ENV.fetch('HELO_PORT', '2525'),
|
|
authentication: :plain
|
|
}
|
|
end
|
|
end
|