Return-Path: X-Original-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Delivered-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3F5E6105DF for ; Wed, 29 Jan 2014 14:22:23 +0000 (UTC) Received: (qmail 84837 invoked by uid 500); 29 Jan 2014 14:22:19 -0000 Delivered-To: apmail-james-mime4j-dev-archive@james.apache.org Received: (qmail 84627 invoked by uid 500); 29 Jan 2014 14:22:14 -0000 Mailing-List: contact mime4j-dev-help@james.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mime4j-dev@james.apache.org Delivered-To: mailing list mime4j-dev@james.apache.org Received: (qmail 84537 invoked by uid 99); 29 Jan 2014 14:22:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jan 2014 14:22:13 +0000 Date: Wed, 29 Jan 2014 14:22:13 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: mime4j-dev@james.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (MIME4J-236) Valid email with MIME part encoded as quoted printable is flagged as invalid MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MIME4J-236?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved MIME4J-236. -------------------------------------- Resolution: Fixed Fix Version/s: 0.7.3 Fixed in SVN trunk and 0.7 branch. Please review / re-test. Oleg > Valid email with MIME part encoded as quoted printable is flagged as invalid > ---------------------------------------------------------------------------- > > Key: MIME4J-236 > URL: https://issues.apache.org/jira/browse/MIME4J-236 > Project: James Mime4j > Issue Type: Bug > Components: parser (core) > Affects Versions: 0.7.2 > Reporter: Justin McCartney > Fix For: 0.7.3 > > Attachments: test-email.txt > > > I was using Mime4j to validate some emails supplied through an API to one of our internal systems. Strict parsing was set to true. > Here is the behaviour of Mime4j that is I feel incorrect in QuotedPrintableInputStream. > A text file used as an inline attachment: > Content-Type: text/plain; charset=Cp1252 > Content-Transfer-Encoding: quoted-printable > The second line below causes an error. For clarity's sake I have added the the new line characters as CR and LF. > CRLF > SVG/1.1/DTD/svg11.dtd" >CRLF > The stack trace of the error: > Caused by: java.io.IOException: Found LF without CR > at org.apache.james.mime4j.codec.QuotedPrintableInputStream.read0(QuotedPrintableInputStream.java:194) > at org.apache.james.mime4j.codec.QuotedPrintableInputStream.read(QuotedPrintableInputStream.java:306) > at java.io.InputStream.read(InputStream.java:101) > at org.apache.james.mime4j.message.BasicBodyFactory.bufferContent(BasicBodyFactory.java:53) > at org.apache.james.mime4j.message.BasicBodyFactory.textBody(BasicBodyFactory.java:43) > at org.apache.james.mime4j.message.EntityBuilder.body(EntityBuilder.java:151) > at org.apache.james.mime4j.parser.MimeStreamParser.parse(MimeStreamParser.java:133) > at org.apache.james.mime4j.message.DefaultMessageBuilder.parseMessage(DefaultMessageBuilder.java:311) > I believe that second line in my example is correct. It was created by Sun's com.sun.mail.util.QPEncoderStream. > The equals indicates a soft line break and the following CRLF is the valid new line marker for the mail message. -- This message was sent by Atlassian JIRA (v6.1.5#6160)