classpathx-javamail
[Top][All Lists]
Advanced

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

[Classpathx-javamail] Problem with parsing MimeMessage from InputStream


From: Robert Mitchell
Subject: [Classpathx-javamail] Problem with parsing MimeMessage from InputStream
Date: Fri, 04 Mar 2005 10:55:44 -0500

I have some code where I want to parse a section of a message (read from IMAP) as a MIME message using "new MimeMessage(session, part.getInputStream())".  The input stream uses CRLF as line breaks, but the code which parses the headers treats only the LF as the end of line, leaving the CR on the end of each header line.  Worse, this means that the blank line which separates the headers from the body becomes a line containing a CR, meaning the end of the headers is never detected.
 
I've traced it to code in InternetHeaders which uses a LineInputStream to parse the headers.  It is possible that all that needs to be done is to use an instance of CRLFInputStream as an intermediate wrapper.  Unfortunately, I do not know the overall system well enough to be sure that would not have unexpected consequences on other call paths into the InternetHeaders constructor.
 
Bob Mitchell.
 

reply via email to

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