diff --git a/app/mailers/mailer.rb b/app/mailers/mailer.rb index 8182d0e2..21b8f9bb 100644 --- a/app/mailers/mailer.rb +++ b/app/mailers/mailer.rb @@ -95,7 +95,9 @@ class Mailer < ActionMailer::Base reply_email_domain = FoodsoftConfig[:reply_email_domain] if reply_email_domain && !args[:return_path] - address = Mail::Parsers::AddressListsParser.new.parse(args[:to]).addresses.first + #TODO: Remove workaround for https://github.com/mikel/mail/issues/39 after next mail release + 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}>" end