diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-03-28 09:39:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-28 09:39:31 +0200 |
commit | 56edc6552f71a1f58fd8ca5ea2f0603015be0c2c (patch) | |
tree | 1bc5aded09d9ca560bc819b3d706a0fd99055eb7 /config/environments | |
parent | 2c45859ca9076c0b9916922e0be21ff83fc3b143 (diff) |
Add `SMTP_RETURN_PATH` environment variable to set bounce domain (#17886)
Diffstat (limited to 'config/environments')
-rw-r--r-- | config/environments/production.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/config/environments/production.rb b/config/environments/production.rb index 7fe381040..b003cce9e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -91,11 +91,13 @@ Rails.application.configure do # E-mails outgoing_email_address = ENV.fetch('SMTP_FROM_ADDRESS', 'notifications@localhost') - outgoing_mail_domain = Mail::Address.new(outgoing_email_address).domain + outgoing_email_domain = Mail::Address.new(outgoing_email_address).domain + config.action_mailer.default_options = { from: outgoing_email_address, reply_to: ENV['SMTP_REPLY_TO'], - 'Message-ID': -> { "<#{Mail.random_tag}@#{outgoing_mail_domain}>" }, + return_path: ENV['SMTP_RETURN_PATH'], + message_id: -> { "<#{Mail.random_tag}@#{outgoing_email_domain}>" }, } config.action_mailer.smtp_settings = { |