You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by "Benoit Tellier (Jira)" <mi...@james.apache.org> on 2024/05/02 09:41:00 UTC
[jira] [Closed] (MIME4J-327) Korean characters in eml file's "To" header not parsed correctly when not base64-encoded
[ https://issues.apache.org/jira/browse/MIME4J-327?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benoit Tellier closed MIME4J-327.
---------------------------------
Fix Version/s: 0.8.12
Resolution: Fixed
> Korean characters in eml file's "To" header not parsed correctly when not base64-encoded
> ----------------------------------------------------------------------------------------
>
> Key: MIME4J-327
> URL: https://issues.apache.org/jira/browse/MIME4J-327
> Project: James Mime4j
> Issue Type: Bug
> Affects Versions: 0.8.10
> Environment: JDK 17, MacOS (also tried on Linux: same result)
> Reporter: Yoni Gibbs
> Priority: Major
> Fix For: 0.8.12
>
> Attachments: base64-encoded.eml, not-base64-encoded.eml
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> We are trying to parse an eml file where one of the recipients has a name containing Korean characters. If the {{To:}} header is base64-encoded, it's fine; if it's not base64-encoded, it fails to be read the name correctly.
> Say we have an eml file with this header:
> {{ To: =?UTF-8?B?7Iuc7ZeY?= <ko...@example.com>}}
> This parses fine.
> But with the following header the name is parsed incorrectly:
> {{ To: "시험" <ko...@example.com>}}
> We am using {{{}org.apache.james:apache-mime4j:0.8.10{}}}, and this is some sample Java code to that produces the issue:
> {{ var is = Main.class.getClassLoader().getResourceAsStream("not-base64-encoded.eml");}}
> {{ var parsed = new DefaultMessageBuilder().parseMessage(is);}}
> {{ var to = ((Mailbox) parsed.getTo().get(0)).getName();}}
> {{ assertEquals("시험", to);}}
> Note that to generate an eml with the two different possible headers above we are using {{{}org.eclipse.angus:angus-mail:2.0.2{}}}. The default behaviour there is to generate the base64-encoded header. However if you set the {{mail.mime.allowutf8}} property in the SMTP session to true then it creates the not-base64-encoded header, which causes the problem for mime4j.
> Does this look like a bug in mime4j? Or is there something we're not doing correctly?
> Thanks in advance!
--
This message was sent by Atlassian Jira
(v8.20.10#820010)