Add handling for bounce mails
This commit is contained in:
parent
97abcabffa
commit
578e929e0d
3 changed files with 24 additions and 0 deletions
|
|
@ -89,6 +89,12 @@ class Mailer < ActionMailer::Base
|
|||
args[k] = "#{show_user user} <#{user.email}>" if user.is_a? User
|
||||
end
|
||||
|
||||
reply_email_domain = FoodsoftConfig[:reply_email_domain]
|
||||
if reply_email_domain && !args[:return_path]
|
||||
address = Mail::Parsers::AddressListsParser.new.parse(args[:to]).addresses.first
|
||||
args[:return_path] = "<#{FoodsoftConfig.scope}.bounce+#{address.local}=#{address.domain}@#{reply_email_domain}>"
|
||||
end
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue