プロジェクト

全般

プロフィール

Vote #78176

未完了

Issue processing UTF7 mails

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
New
優先度:
低め
担当者:
-
カテゴリ:
Email receiving_29
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
29
version_id:
0
issue_org_id:
24910
author_id:
186345
assigned_to_id:
0
comments:
8
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

Hello,

we have an issue with processing UTF7 mails:

exception: code converter not found (UTF-7 to UTF-8)
["/srv/redmine/public_html/lib/redmine/codeset_util.rb:25:in encode'", "/srv/redmine/public_html/lib/redmine/codeset_util.rb:25:into_utf8'"

Are there any ideas to solve this issue?

Thx
Falk


journals

--------------------------------------------------------------------------------
<pre>
$ cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)

$ irb
1.9.3-p551 :001 > str = "test".force_encoding("UTF-7")
=> "\x74\x65\x73\x74"
1.9.3-p551 :002 > str = str.encode("UTF-8", :invalid => :replace,:undef => :replace, :replace => '?')
Encoding::ConverterNotFoundError: code converter not found (UTF-7 to UTF-8)
from (irb):2:in `encode'
from (irb):2
from /home/xxxx/.rvm/rubies/ruby-1.9.3-p551/bin/irb:12:in `<main>'
</pre>
--------------------------------------------------------------------------------
It seems Ruby does not have UTF-7 converter.

"Code converter not found (UTF-8 to EUC-TW)": https://bugs.ruby-lang.org/issues/6995
--------------------------------------------------------------------------------
This "encyclopedia":https://www.everipedia.com/UTF7/ article for UTF7 seems to be a good place to start
--------------------------------------------------------------------------------
@Toshi: utf-7 is relevant only for email processing. Ruby still supports it, but it's a little bit tricky. This will work:

<pre>
require "net/imap"
Net::IMAP.decode_utf7(mail_body)
</pre>

--------------------------------------------------------------------------------
The same problem with _Windows-1258_. Attached patch should cover all not supported code pages.
--------------------------------------------------------------------------------
@karel
could you add a more realistic test case with an email as a fixture?
https://github.com/redmine/redmine/blob/3ac569c4d8c8b04a9cc33e3c2a05f8553d99827e/test/unit/mail_handler_test.rb#L542

it should be already fixed by
https://github.com/mikel/mail/pull/1112
--------------------------------------------------------------------------------
A test with a real Vietnamese email added into the patch.
--------------------------------------------------------------------------------

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0