From 5414d86050887945780ea5e9bf2c8c6ff12faa9c Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Fri, 4 Mar 2016 06:56:06 +0000 Subject: [PATCH] fix received mail text attachment does not keep original encoding on Ruby >= 2.1 (#21742) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributed by Pavel Rosický. git-svn-id: http://svn.redmine.org/redmine/trunk@15184 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/mail_handler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index cff397a52..7ec8ede24 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -290,7 +290,7 @@ class MailHandler < ActionMailer::Base email.attachments.each do |attachment| next unless accept_attachment?(attachment) obj.attachments << Attachment.create(:container => obj, - :file => attachment.decoded, + :file => attachment.body.decoded, :filename => attachment.filename, :author => user, :content_type => attachment.mime_type)