Convert received mail to default encoding

This fixes a problem when the received mail does not use UTF-8 as encoding.
This commit is contained in:
Patrick Gansterer 2017-10-10 18:01:32 +02:00
parent 380bd62168
commit 499758edc4

View file

@ -41,6 +41,7 @@ class MessagesMailReceiver
body = Nokogiri::HTML(body).text body = Nokogiri::HTML(body).text
end end
body.encode!(Encoding::default_internal)
body = EmailReplyTrimmer.trim(body) body = EmailReplyTrimmer.trim(body)
message = @user.send_messages.new body: body, message = @user.send_messages.new body: body,