Patch #15785 » 15785.patch
| app/models/mail_handler.rb | ||
|---|---|---|
|
part.header[:content_disposition].try(:disposition_type) == 'attachment'
|
||
|
end
|
||
|
@plain_text_body = parts.map {|p| Redmine::CodesetUtil.to_utf8(p.body.decoded, p.charset)}.join("\r\n")
|
||
|
@plain_text_body = parts.map {|p| Redmine::CodesetUtil.to_utf8(p.body.decoded, Mail::RubyVer.pick_encoding(p.charset).to_s)}.join("\r\n")
|
||
|
# strip html tags and remove doctype directive
|
||
|
if parts.any? {|p| p.mime_type == 'text/html'}
|
||
| test/fixtures/mail_handler/body_ks_c_5601-1987.eml | ||
|---|---|---|
|
From: John Smith <JSmith@somenet.foo>
|
||
|
To: "redmine@somenet.foo" <redmine@somenet.foo>
|
||
|
Subject: This is a test
|
||
|
Content-Type: multipart/alternative;
|
||
|
boundary="_c20d9cfa-d16a-43a3-a7e5-71da7877ab23_"
|
||
|
--_c20d9cfa-d16a-43a3-a7e5-71da7877ab23_
|
||
|
Content-Type: text/plain; charset="ks_c_5601-1987"
|
||
|
Content-Transfer-Encoding: base64
|
||
|
sO24v73AtM+02S4=
|
||
|
--_c20d9cfa-d16a-43a3-a7e5-71da7877ab23_--
|
||
| test/unit/mail_handler_test.rb | ||
|---|---|---|
|
assert_equal ja, issue.subject
|
||
|
end
|
||
|
def test_add_issue_with_korean_body
|
||
|
# Make sure mail bodies with a charset unknown to Ruby but known to the
|
||
|
# Mail gem are handled correctly
|
||
|
issue = submit_email(
|
||
|
'body_ks_c_5601-1987.eml',
|
||
|
:issue => {:project => 'ecookbook'}
|
||
|
)
|
||
|
assert_kind_of Issue, issue
|
||
|
kr = "\xEA\xB3\xA0\xEB\xA7\x99\xEC\x8A\xB5\xEB\x8B\x88\xEB\x8B\xA4."
|
||
|
kr.force_encoding('UTF-8') if kr.respond_to?(:force_encoding)
|
||
|
assert_equal kr, issue.description
|
||
|
end
|
||
|
def test_add_issue_with_no_subject_header
|
||
|
issue = submit_email(
|
||
|
'no_subject_header.eml',
|
||