From mime4j-dev-return-1201-apmail-james-mime4j-dev-archive=james.apache.org@james.apache.org Tue Jan 11 08:03:18 2011 Return-Path: Delivered-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Received: (qmail 70974 invoked from network); 11 Jan 2011 08:03:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Jan 2011 08:03:18 -0000 Received: (qmail 79972 invoked by uid 500); 11 Jan 2011 08:03:17 -0000 Delivered-To: apmail-james-mime4j-dev-archive@james.apache.org Received: (qmail 79907 invoked by uid 500); 11 Jan 2011 08:03:15 -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 Delivered-To: moderator for mime4j-dev@james.apache.org Received: (qmail 60693 invoked by uid 99); 11 Jan 2011 07:47:28 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Message-ID: <4D2C0AEE.5070700@virtualpostman.co.za> Date: Tue, 11 Jan 2011 09:46:54 +0200 From: Jesse Long User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: mime4j-dev@james.apache.org Subject: Incorrect line length limitation while parsing headers Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Please see the following code in mime4j 0.6: http://james.apache.org/mime4j/xref/org/apache/james/mime4j/parser/AbstractEntity.html#133 The for loop checks for excess line length in headers based on the complete length of the header, not on each individual line in the header. So, my header like this: X-Header-Name: <980 chars> <20 chars> <25 chars> fails, because the complete length of the header is > 1000, however, no line in the mime message is longer than 1000 chars... I suggest just removing the check for excess line length in the fillFieldBuffer() method. Cheers, Jesse