[ https://issues.apache.org/jira/browse/MIME4J-327?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17829606#comment-17829606 ]
Yoni Gibbs edited comment on MIME4J-327 at 3/21/24 4:53 PM: ------------------------------------------------------------ Hey, thanks for the reply! Unfortunately the new version doesn't seem to fix it. I've put up a repo where you can replicate the issue, in case it's of use: [https://github.com/yonigibbs/mime4j-korean|https://github.com/yonigibbs/mime4j-korean.]. Just run {{./gradlew test}} in there. Let me know if there's anything I can do to help. was (Author: JIRAUSER304691): Hey, thanks for the reply! Unfortunately the new version doesn't seem to fix it. I've put up a repo where you can replicate the issue, in case it's of use: [https://github.com/yonigibbs/mime4j-korean.] Just run {{./gradlew test}} in there. Let me know if there's anything I can do to help. > 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 > Attachments: base64-encoded.eml, not-base64-encoded.eml > > > 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?= <koreant...@example.com>}} > This parses fine. > But with the following header the name is parsed incorrectly: > {{ To: "시험" <koreant...@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)