Remove mail workaround after upgrade to 2.7

This commit is contained in:
Patrick Gansterer 2018-12-11 15:43:36 +01:00
parent 71fd6f2a24
commit 8d1dbe1448

View file

@ -112,9 +112,7 @@ class Mailer < ActionMailer::Base
reply_email_domain = FoodsoftConfig[:reply_email_domain] reply_email_domain = FoodsoftConfig[:reply_email_domain]
if reply_email_domain && !args[:return_path] && args[:to].is_a?(String) if reply_email_domain && !args[:return_path] && args[:to].is_a?(String)
#TODO: Remove workaround for https://github.com/mikel/mail/issues/39 after next mail release address = Mail::Parsers::AddressListsParser.parse(args[:to]).addresses.first
ascii_to = args[:to].encode('ASCII', invalid: :replace, undef: :replace, replace: '_')
address = Mail::Parsers::AddressListsParser.new.parse(ascii_to).addresses.first
args[:return_path] = "<#{FoodsoftConfig.scope}.bounce+#{address.local}=#{address.domain}@#{reply_email_domain}>" args[:return_path] = "<#{FoodsoftConfig.scope}.bounce+#{address.local}=#{address.domain}@#{reply_email_domain}>"
end end