Problem with parsing MimeMessage from InputStream

"Robert Mitchell" <[email protected]>
Newsgroups gmane.comp.java.classpath.extensions.javamail
Message-ID <[email protected]>
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.

_______________________________________________
Classpathx-javamail mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpathx-javamail
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.