[ https://issues.apache.org/jira/browse/JAMES-3178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17104130#comment-17104130 ]
Benoit Tellier commented on JAMES-3178: --------------------------------------- https://github.com/linagora/james-project/pull/3368 proposes a fix for this > AutomaticSentMail detector should bypass javax.mail parsing > ----------------------------------------------------------- > > Key: JAMES-3178 > URL: https://issues.apache.org/jira/browse/JAMES-3178 > Project: James Server > Issue Type: Improvement > Components: Mailet Contributions > Reporter: Benoit Tellier > Priority: Major > Labels: bug > > We rely on `mime4j` for mail content parsing, we should bypass the implicit > parsing and sanitizing performed in `MimeMessage::getInputStream`. > As the JavaX.mail javadoc says: > {code:java} > Return a decoded input stream for this Message's "content". > {code} > To do so, we can use MimeMessageInputStream in james-server-core, wich also > implies relocating `AutomaticallySentMailDetectorImpl`. > Note that javax parsing is less robust than mime4j one, leading to the > following exception: > {code:java} > javax.mail.MessagingException: Can not read content > at > org.apache.mailet.base.AutomaticallySentMailDetectorImpl.isMdnSentAutomatically(AutomaticallySentMailDetectorImpl.java:107) > at > org.apache.mailet.base.AutomaticallySentMailDetectorImpl.isAutomaticallySent(AutomaticallySentMailDetectorImpl.java:54) > at > org.apache.james.jmap.mailet.VacationMailet.service(VacationMailet.java:72) > at > org.apache.james.mailetcontainer.impl.camel.CamelProcessor.process(CamelProcessor.java:77) > [...] > Caused by: java.io.IOException: Unknown encoding: 8bitMIME-version > at > javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:116) > at javax.activation.DataHandler.getInputStream(DataHandler.java:238) > at javax.mail.internet.MimeMessage.getInputStream(MimeMessage.java:1395) > at > org.apache.james.server.core.MimeMessageCopyOnWriteProxy.getInputStream(MimeMessageCopyOnWriteProxy.java:265) > at > org.apache.mailet.base.AutomaticallySentMailDetectorImpl.isMdnSentAutomatically(AutomaticallySentMailDetectorImpl.java:103) > ... 92 common frames omitted > Caused by: javax.mail.MessagingException: Unknown encoding: 8bitMIME-version > at javax.mail.internet.MimeUtility.decode(MimeUtility.java:405) > at > javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSource.java:109) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org