Re: Parsing a MimeMultipart

Chris Burdess <[email protected]> Wed, 16 May 2007 15:56:22 +0100
Newsgroups gmane.comp.java.classpath.extensions.javamail
Message-ID <[email protected]>
remi__ wrote:
> I am using the classpathx-mail implentation of Javamail through  
> JOnAS 4.8.4.
> It is the version 1.1.1
> I actually have a problem parsing a mail with a multipart content.
>
> Here is the multipart section of the original message (mail  
> retrieved using
> the IMAP protocol). I dropped the routing information and just  
> display the
> mulipart section:
>
> Content-Type: multipart/mixed;
> boundary="----=_Part_0_12966337.1179326080592"
> ------=_Part_0_12966337.1179326080592
> Content-Type: text/plain; charset=windows-1252
> Content-Transfer-Encoding: 7bit
>
> ------=_Part_0_12966337.1179326080592
> Content-Type: text/plain;
> name=testListeMultiPJ_16052007_163439_0157_Z4W897.xml
> Content-Transfer-Encoding: 7bit
> Content-Disposition: attachment;
> filename=testListeMultiPJ_16052007_163439_0157_Z4W897.xml
>
> <?xml version="1.0" encoding="UTF-8"?>
> <test> content ...... </test>
> ------=_Part_0_12966337.1179326080592
>
> I cast the message content to a Multipart :
> Multipart piecesMessage = (Multipart) message.getContent();
>
> Here is what I get if I display the bodypart related to the xml file:
>
> Content-Type: text/plain;
> name=testListeMultiPJ_16052007_164150_0159_LG7FFCQU7AUKN3XFW
> Content-Transfer-Encoding: 2
> Content-Id: 7bit
> Content-Description: 558
>
> It seems that the parser does not give the right values to the  
> respective
> content-headers.
>
> Is there any bug in the implementation or am I using the library in  
> a wrong
> way?

There may be a bug, it's pretty difficult for me to tell or not from  
the information you're giving me.

If you can provide a test case, it would help to determine what the  
issue is.