diff --git a/config/environments/development.rb b/config/environments/development.rb index 0d61e564..628cb812 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -69,7 +69,7 @@ config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } # Necessary for Devise mails config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { - :address => 'maildev', + :address => 'mail', :port => 25, :openssl_verify_mode => 'none' } diff --git a/config/environments/production.rb b/config/environments/production.rb index 8e2bb923..c1e18d7d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -63,11 +63,18 @@ # config.active_job.queue_adapter = :resque # config.active_job.queue_name_prefix = "gbo_lapp_#{Rails.env}" - config.action_mailer.perform_caching = false + # config.action_mailer.perform_caching = false # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false + config.action_mailer.raise_delivery_errors = true + + config.action_mailer.default_url_options = { host: ENV['PROJECT_DOMAIN'] } # Necessary for Devise mails + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { + :address => 'mail', + :port => 25 + } # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found). @@ -91,15 +98,4 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - - # For Devise - config.action_mailer.default_url_options = { host: ENV['PROJECT_DOMAIN'] } - config.action_mailer.delivery_method = :smtp - config.action_mailer.smtp_settings = { - address: '127.0.0.1', - port: 25, - domain: ENV['PROJECT_DOMAIN'], - tls: false, - enable_starttls_auto: false - } end diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 3e9e72ab..3bc86e25 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,5 +1,5 @@ services: - maildev: + mail: image: djfarrelly/maildev ports: - "1080:80" diff --git a/docker-compose.yml b/docker-compose.yml index 26f7df6c..b4de8f2e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,6 +62,13 @@ services: ports: - ${PORT}:${PORT} + mail: + image: boky/postfix:latest + environment: + ALLOWED_SENDER_DOMAINS: ${PROJECT_DOMAIN} + ports: + - '1578:578' + volumes: bwm-redis: bwm-postgres: