Project

General

Profile

« Previous | Next » 

Revision 2520cf92

Added by Marc Dequènes over 14 years ago

  • ID 2520cf9286859760737384e2a5f36a6fcf707ec2

[fix] handle mail unquoting and conversion to UTF-8 better

View differences:

lib/cyborghood/mail.rb
@mail = msg
else
# unquote headers and transform into TMail object
@mail = TMail::Mail.parse(TMail::Unquoter.unquote_and_convert_to(msg, "UTF-8"))
@mail = TMail::Mail.parse(msg)
end
end
......
def create_reply
tmail_reply = @mail.create_reply
tmail_reply.from_addrs = TMail::Address.parse(@config.mail.from_address || self.to.first)
tmail_reply.to_addrs = @mail.from_addrs.collect do |a|
address = TMail::Unquoter.unquote_and_convert_to(a.to_s, "UTF-8")
quoted_address = quote_address_if_necessary(address, "UTF-8")
TMail::Address.parse(quoted_address)
end
reply = self.class.new(tmail_reply.to_s)
reply.set_custom_headers
reply.user = self.user

Also available in: Unified diff