issues@javamail.java.net

[Bug 5218] New: BODYSTRUCTURE does not correctly parse extension fields for single-part message

From: <bugzilla-daemon_at_kenai.com>
Date: Fri, 11 May 2012 18:18:36 +0000

http://kenai.com/bugzilla/show_bug.cgi?id=5218

             Bug #: 5218
           Summary: BODYSTRUCTURE does not correctly parse extension
                    fields for single-part message
    Classification: Unclassified
           Product: javamail
           Version: 1.4.5
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: imap
        AssignedTo: shannon_at_kenai.com
        ReportedBy: kdgregory_at_kenai.com
                CC: issues_at_javamail.kenai.com


We are encountering an exception when retrieving the Content-Type header of a
single-part message from Microsoft Exchange 365. The following debug flags are
in effect:

 - Session.setDebug(true)
 - System.setProperty("mail.imap.parse.debug", "true")

===snip===
A6 FETCH 3099 (BODYSTRUCTURE)
* 3099 FETCH (BODYSTRUCTURE ("text" "plain" ("charset" "utf-8") NIL NIL
"quoted-printable" 802 19 NIL "inline" NIL NIL))
DEBUG IMAP: parsing BODYSTRUCTURE
DEBUG IMAP: msgno 3099
DEBUG IMAP: single part
DEBUG IMAP: type text
DEBUG IMAP: subtype plain
DEBUG IMAP: parameter name charset
DEBUG IMAP: parameter value utf-8
DEBUG IMAP: cParams ; charset=utf-8
DEBUG IMAP: id null
DEBUG IMAP: description null
DEBUG IMAP: encoding quoted-printable
DEBUG IMAP: size 802
DEBUG IMAP: lines 19
A6 OK FETCH completed.
DEBUG IMAP: IMAPProtocol noop
A7 NOOP
===snip===

In BODYSTRUCTURE.java:138, there is a call to parseParameters(); looking at
this method, it appears to either expect a parenthesized list of parameters or
NIL.

However, RFC 3501 doesn't appear to require that extension parameters be passed
as a parenthesized list for single-part messages
(http://tools.ietf.org/html/rfc3501#section-7.4.2). Unfortunately, there are no
examples, and it does look like parenthesis are required for multi-part
messages.

-- 
Configure bugmail: http://kenai.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.