classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Classpathx-javamail] bug found


From: Archit Shah
Subject: [Classpathx-javamail] bug found
Date: Tue, 07 Jun 2005 16:52:35 -0400
User-agent: Mozilla Thunderbird 1.0.2-1.3.3 (X11/20050513)

A bug in classpathx mail was found when using it with Apache Axis. The problem is in source/javax/mail/internet/InternetHeaders.java. I've attached a junit test case that shows how the class operates differently on buffered versus unbuffered input streams. I believe line 335 is the key:

LineInputStream in = new LineInputStream(new CRLFInputStream(is));

The CRLFInputStream wraps the original input stream in a buffered input stream when markSupported() returns false. If there is data in the original input stream after the headers, then it gets lost in the buffered input stream created in the CRLFInputStream constructor. Changing InternetHeaders to not use CRLFInputStream seems to fix the problem (patch attached):

LineInputStream in = new LineInputStream(is);

This change also re-instates the recognition of either '\n' or '\r\n' as line terminators in header parsing. This matches the behavior of the rfc822 module in python 2.3 and doesn't seem unreasonable.

 -- Archit Shah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]