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
1 changed files with 1 additions and 0 deletions

View File

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