issues@javamail.java.net

[Bug 5816] New: Issue in decoding filename with charset iso-2022-jp from Mime header based on rfc 2231

From: <bugzilla-daemon_at_kenai.com>
Date: Mon, 28 Jan 2013 15:06:11 +0000

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

             Bug #: 5816
           Summary: Issue in decoding filename with charset iso-2022-jp
                    from Mime header based on rfc 2231
    Classification: Unclassified
           Product: javamail
           Version: 1.4.5
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: other
        AssignedTo: shannon_at_kenai.com
        ReportedBy: Manimekalai_at_kenai.com
                CC: issues_at_javamail.kenai.com


In javamail i set mail.mime.decodeparameter as true. I have the Mimeheader for
the attachment as below.

Content-Type: image/png;
 name*0*=ISO-2022-JP''%1B%24B%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26;
 name*1*=%24%28%24*%24%22%24%24%24%26%24%28%24*%24%22%24%24%24%26%24%28;
 name*2*=%24*%1B%28B.png
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename*0*=ISO-2022-JP''%1B%24B%24%22%24%24%24%26%24%28%24*%24%22%24%24;
 filename*1*=%24%26%24%28%24*%24%22%24%24%24%26%24%28%24*%24%22%24%24%24;
 filename*2*=%26%24%28%24*%1B%28B.png

While getting filename using part.getFileName(), the filename not rendered
properly. The filename has been rendered as below.

あいうえおあいう$&$($*$"$$$&$($*$"$$$&$($*.png

But the actual filename is あいうえおあいうえおあいうえおあいうえお.png .

When i debug the source of javamail, in the ParameterList.java in the
decodeBytes() method return corrupted string for the value pf continuation
parameters, when the encoded string are split. I think when double bytes
charset such as iso-2022-jp are splitted it returns corrupted string in
javamail. Whether Am I correct? Or please suggest me workaround to solve this
issue.

P.S I have already reported this issue in stackoverflow.com and mailed to the
email address javamail_ww_at_oracle.com.

-- 
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.