ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Veithen (JIRA)" <>
Subject [jira] [Commented] (AXIOM-467) Cannot read "quoted-printable" encoded data from MIME part
Date Sat, 16 May 2015 01:28:00 GMT


Andreas Veithen commented on AXIOM-467:

I'm extremely reluctant to switch MIME4J to relax mode. There are several reasons for that:

* MIME4J is designed to process email messages. There are thousands of software products that
process email messages, and many of them fail (or failed) to follow the standards strictly.
To be interoperable, MIME4J has no other choice than to support messages produced by these
non conforming systems (and it's probably much more lenient than JavaMail). The situation
is fairly different for Web services: most systems that produce SwA or MTOM messages effectively
only use a small subset of the MIME specs (e.g. most implementations will only ever use the
"binary" encoding) and they correctly implement the parts of the specs they use. That means
that in contrast to email processing, there should be much less need to support interoperability
with non conforming systems. That's why I was asking for a real world example of a message
that would require this.

* Building implementations of communication protocols that are more lenient than necessary
effectively encourages people to build implementations that rely on this and don't follow
the standards. That's how you end up with issues like this:
That's generally a bad thing to do because it eventually makes lives harder for everybody.

* Axiom's public API doesn't depend on MIME4J, only its implementation does. That means that
we have the freedom to replace MIME4J by something else in the future (and this is BTW how
we replaced a mixture of JavaMail and custom code by MIME4J in Axiom 1.2.13). Using relax
mode makes this more difficult, precisely because of the backward incompatibility argument.

> Cannot read "quoted-printable" encoded data from MIME part
> ----------------------------------------------------------
>                 Key: AXIOM-467
>                 URL:
>             Project: Axiom
>          Issue Type: Bug
>          Components: API
>    Affects Versions: 1.2.13, 1.2.14
>            Reporter: Detelin Hadzhiev
>             Fix For: 1.2.16
>         Attachments: MtomInvalidQPAttachment.txt, axiom-1.2.13.patch, axiom_1.2.7.patch
> Processing "quoted-printable" encoded data in the axiom v.1.2.13 seems to be backward
incompatible as it was in the axiom. 1.2.7.
> I provided one and the same test case which illustrates how the test is working in the
axiom 1.2.7 but not in 1.2.13.
> In the axiom 1.2.13 I got the following exception:
> Error reading
from source
> 	at org.apache.axiom.attachments.PartContentFactory.createPartContent(
> 	at org.apache.axiom.attachments.PartImpl.fetch(
> 	at org.apache.axiom.attachments.PartImpl.getContent(
> 	at org.apache.axiom.attachments.PartImpl.getInputStream(
> 	at org.apache.axiom.attachments.PartDataSource.getInputStream(
> 	at javax.activation.DataHandler.getInputStream(
> 	at org.apache.axiom.attachments.QuotedPrintablePartTest.testReadStreamFromPart(
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> 	at java.lang.reflect.Method.invoke(
> 	at junit.framework.TestCase.runTest(
> 	at junit.framework.TestCase.runBare(
> 	at junit.framework.TestResult$1.protect(
> 	at junit.framework.TestResult.runProtected(
> 	at
> 	at
> 	at junit.framework.TestSuite.runTest(
> 	at
> 	at
> 	at
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> 	at
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> Caused by: Error reading from source
> 	at org.apache.axiom.attachments.utils.BAAOutputStream.readFrom(
> 	at org.apache.axiom.attachments.impl.BufferUtils.inputStream2OutputStream(
> 	at org.apache.axiom.attachments.PartContentFactory.createPartContent(
> 	... 24 more
> Caused by: Found LF without CR
> 	at org.apache.james.mime4j.codec.QuotedPrintableInputStream.read0(
> 	at
> 	at org.apache.axiom.attachments.utils.BAAOutputStream.readFrom(
> 	... 26 more
> The root cause of this exception is that AXIOM forces usage of the STRICT mode of MIME4J
for decoding found in org.apache.axiom.attachments.MIMEMessage class
>     MimeConfig config = new MimeConfig();
>     config.setStrictParsing(true);
> The default behavior MIME4J is SILENT(relaxed)  mode, if the strict parsing is not enforced
that the test will pass successfully.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message