users@javamail.java.net

Re: javamail-1.4.4-src: com.sun.mail.imap.protocol.FetchResponse case sensitive

From: Bill Shannon <bill.shannon_at_oracle.com>
Date: Mon, 20 Feb 2012 13:27:48 -0800

(Sending again with correct email address...)


Yes, that most certainly looks like a bug! Thanks for reporting it!

(I think you have to create a kenai.com account and login before subscribing
to the mailing lists.)

Petite Abeille wrote on 02/20/12 12:59:
> (Apologies for the direct mail, but I'm at loss about how to subscribe to the mailing list)
>
> Hello,
>
> Looks like com.sun.mail.imap.protocol.FetchResponse is case sensitive.
>
> For example:
>
> C: A5 FETCH 1 (ENVELOPE INTERNALDATE RFC822.SIZE)
> S: * 1 fetch (envelope (...
>
> Will result in an exception:
>
> Failed to load IMAP envelope
> javax.mail.MessagingException: Failed to load IMAP envelope
> at com.sun.mail.imap.IMAPMessage.loadEnvelope(IMAPMessage.java:1243)
> at com.sun.mail.imap.IMAPMessage.getFrom(IMAPMessage.java:237)
> at msgshow.dumpEnvelope(msgshow.java:356)
> at msgshow.main(msgshow.java:216)
>
> The issue seems to be line 127 in com.sun.mail.imap.protocol.FetchResponse.java:
>
> switch(buffer[index]) {
> case 'E':
> if (match(ENVELOPE.name)) {
>
> The switch is done on the raw buffer content but expects upper case characters, even though the token comparison should be case insensitive (as per match).
>
> Perhaps an additional Character.toUpperCase((char)buffer[index]) would do the trick.
>
> HTH.
>
> Cheers,
>
> PA.
>
>
>
>
>
>
>
>
>