You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by Serge Sozonoff <se...@globalbeach.com> on 2002/10/31 22:13:59 UTC

JavaMail mime header parsing

Hi All,

Sorry for this slightly off topic subject, hoping someone has a simple
answer.

My understanding of RFC2045 section 3.  MIME Header Fields leaves me to
beleive that both of the following representations are correct:

Content-Type: multipart/related;
boundary=mmsc-mgw-unique-boundary-1;type="application/smil";start="<89168876
9>"
Content-Type: multipart/related;
boundary=mmsc-mgw-unique-boundary-1;type=application/smil;start=<891688769>

Note that one has some double quotes and one does not.

However when I run the non-quoted version through JavaMail 1.2 and 1.3 I get
a ParseException or MessagingException depending on the operation I am
doing.
Is there a but in JavaMail or is my understanding of the RFC wrong?

Any thoughts on upgrading the JavaMail extension in James, I beleive we are
still using 1.2 (I have found no specific reason for suggesting this, but
there were some bug fixes and it might benefit those using JavaMail for
their mailets.

Thanks, Serge

Example code to see this in action

import javax.mail.internet.*;

class test {
    public static void main(String[] args) {
        try {
            String header = "multipart/related;
boundary=mmsc-mgw-unique-boundary-1;type=application/smil;start=<891688769>"
;
            ContentType cType = new ContentType(header);
            System.out.println(cType.toString());
        } catch(ParseException pe) {
            System.out.println("Parse error");
            pe.getMessage();
        }
    }
}



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JavaMail mime header parsing

Posted by Danny Angus <da...@apache.org>.
pls submit this to bugzilla, its been on my radar for a while, but keeps slipping my mind.

> -----Original Message-----
> From: Jason Webb [mailto:jw@inovem.com]
> Sent: 01 November 2002 09:10
> To: 'James Developers List'
> Subject: RE: JavaMail mime header parsing
> 
> 
> We use Javamail 1.3 instead of 1.2. It's got a LOT of bug fixes in the
> Mime code and just seems to be more stable. I just changed the build.xml
> file and everything just works.
> 
> So a thumbs up from me.
> 
> -- Jason
> 
> > -----Original Message-----
> > From: Serge Sozonoff [mailto:serge@globalbeach.com] 
> > Sent: 31 October 2002 21:14
> > To: James Developers List
> > Subject: JavaMail mime header parsing
> > 
> > 
> > Hi All,
> > 
> > Sorry for this slightly off topic subject, hoping someone has 
> > a simple answer.
> > 
> > My understanding of RFC2045 section 3.  MIME Header Fields 
> > leaves me to beleive that both of the following 
> > representations are correct:
> > 
> > Content-Type: multipart/related; 
> > boundary=mmsc-mgw-unique-boundary-1;type="application/smil";st
> > art="<89168876
> > 9>"
> > Content-Type: multipart/related; 
> > boundary=mmsc-mgw-unique-boundary-1;type=application/smil;star
> > t=<891688769>
> > 
> > Note that one has some double quotes and one does not.
> > 
> > However when I run the non-quoted version through JavaMail 
> > 1.2 and 1.3 I get a ParseException or MessagingException 
> > depending on the operation I am doing. Is there a but in 
> > JavaMail or is my understanding of the RFC wrong?
> > 
> > Any thoughts on upgrading the JavaMail extension in James, I 
> > beleive we are still using 1.2 (I have found no specific 
> > reason for suggesting this, but there were some bug fixes and 
> > it might benefit those using JavaMail for their mailets.
> > 
> > Thanks, Serge
> > 
> > Example code to see this in action
> > 
> > import javax.mail.internet.*;
> > 
> > class test {
> >     public static void main(String[] args) {
> >         try {
> >             String header = "multipart/related; 
> > boundary=mmsc-mgw-unique-boundary-1;type=application/smil;star
> > t=<891688769>"
> > ;
> >             ContentType cType = new ContentType(header);
> >             System.out.println(cType.toString());
> >         } catch(ParseException pe) {
> >             System.out.println("Parse error");
> >             pe.getMessage();
> >         }
> >     }
> > }
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> > <mailto:james-dev-> unsubscribe@jakarta.apache.org>
> > For 
> > additional commands, 
> > e-mail: <ma...@jakarta.apache.org>
> > 
> > 
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JavaMail mime header parsing

Posted by Jason Webb <jw...@inovem.com>.
We use Javamail 1.3 instead of 1.2. It's got a LOT of bug fixes in the
Mime code and just seems to be more stable. I just changed the build.xml
file and everything just works.

So a thumbs up from me.

-- Jason

> -----Original Message-----
> From: Serge Sozonoff [mailto:serge@globalbeach.com] 
> Sent: 31 October 2002 21:14
> To: James Developers List
> Subject: JavaMail mime header parsing
> 
> 
> Hi All,
> 
> Sorry for this slightly off topic subject, hoping someone has 
> a simple answer.
> 
> My understanding of RFC2045 section 3.  MIME Header Fields 
> leaves me to beleive that both of the following 
> representations are correct:
> 
> Content-Type: multipart/related; 
> boundary=mmsc-mgw-unique-boundary-1;type="application/smil";st
> art="<89168876
> 9>"
> Content-Type: multipart/related; 
> boundary=mmsc-mgw-unique-boundary-1;type=application/smil;star
> t=<891688769>
> 
> Note that one has some double quotes and one does not.
> 
> However when I run the non-quoted version through JavaMail 
> 1.2 and 1.3 I get a ParseException or MessagingException 
> depending on the operation I am doing. Is there a but in 
> JavaMail or is my understanding of the RFC wrong?
> 
> Any thoughts on upgrading the JavaMail extension in James, I 
> beleive we are still using 1.2 (I have found no specific 
> reason for suggesting this, but there were some bug fixes and 
> it might benefit those using JavaMail for their mailets.
> 
> Thanks, Serge
> 
> Example code to see this in action
> 
> import javax.mail.internet.*;
> 
> class test {
>     public static void main(String[] args) {
>         try {
>             String header = "multipart/related; 
> boundary=mmsc-mgw-unique-boundary-1;type=application/smil;star
> t=<891688769>"
> ;
>             ContentType cType = new ContentType(header);
>             System.out.println(cType.toString());
>         } catch(ParseException pe) {
>             System.out.println("Parse error");
>             pe.getMessage();
>         }
>     }
> }
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:james-dev-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: JavaMail mime header parsing

Posted by "Peter M. Goldstein" <pe...@yahoo.com>.
Serge,

I'm not sure that's the relevant RFC.  The type name/parameter pair is
not addressed in RFC 2045, since it's a parameter specific to the
multipart/related Content-Type.

That said, RFC 2387 which defines the Multipart/Related type, seems to
indicate that it's actually the unquoted version which is correct.
Check out section 3.4 of this RFC.  Although it also seems to say that,
in general, parameters will be quoted.

--Peter

> -----Original Message-----
> From: Serge Sozonoff [mailto:serge@globalbeach.com]
> Sent: Thursday, October 31, 2002 1:14 PM
> To: James Developers List
> Subject: JavaMail mime header parsing
> 
> Hi All,
> 
> Sorry for this slightly off topic subject, hoping someone has a simple
> answer.
> 
> My understanding of RFC2045 section 3.  MIME Header Fields leaves me
to
> beleive that both of the following representations are correct:
> 
> Content-Type: multipart/related;
> boundary=mmsc-mgw-unique-boundary-
> 1;type="application/smil";start="<89168876
> 9>"
> Content-Type: multipart/related;
> boundary=mmsc-mgw-unique-boundary-
> 1;type=application/smil;start=<891688769>
> 
> Note that one has some double quotes and one does not.
> 
> However when I run the non-quoted version through JavaMail 1.2 and 1.3
I
> get
> a ParseException or MessagingException depending on the operation I am
> doing.
> Is there a but in JavaMail or is my understanding of the RFC wrong?
> 
> Any thoughts on upgrading the JavaMail extension in James, I beleive
we
> are
> still using 1.2 (I have found no specific reason for suggesting this,
but
> there were some bug fixes and it might benefit those using JavaMail
for
> their mailets.
> 
> Thanks, Serge
> 
> Example code to see this in action
> 
> import javax.mail.internet.*;
> 
> class test {
>     public static void main(String[] args) {
>         try {
>             String header = "multipart/related;
> boundary=mmsc-mgw-unique-boundary-
> 1;type=application/smil;start=<891688769>"
> ;
>             ContentType cType = new ContentType(header);
>             System.out.println(cType.toString());
>         } catch(ParseException pe) {
>             System.out.println("Parse error");
>             pe.getMessage();
>         }
>     }
> }
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:james-dev-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:james-dev-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>