http://kenai.com/bugzilla/show_bug.cgi?id=5300
Bug #: 5300
Summary: The cachemultipart enhancement is not working properly
in specific use cases
Classification: Unclassified
Product: javamail
Version: 1.4.5
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P5
Component: internet
AssignedTo: shannon_at_kenai.com
ReportedBy: georgi87bg_at_kenai.com
CC: issues_at_javamail.kenai.com
The cachemultipart enhancement is not working properly in specific use cases.
Please also see the following bug opened in BC:
----
http://www.bouncycastle.org/jira/browse/BJA-406
---
And this code which is implemented in 1.4.7.
----
// Paranoia:
// allow this last minute change to be disabled if it causes problems
static final boolean cacheMultipart = // accessed by MimeMessage
PropUtil.getBooleanSystemProperty("mail.mime.cachemultipart", true);
----
I was unable to verify a complex multipart containing a part which is actually
a multipart on its own. The nested multipart has 4 parts, 2 of which are
encrypted.
The problem seems to occur in the method SMIMEUtil.outputBodyPart() which is
processing the nested body part incorrectly. This is working with 1.43.
line 294 - MimeMultipart mp = (MimeMultipart)bodyPart.getContent(); - the mp
object has obviously 4 parts, which is correct. Everything seems OK until we
reach line 328 which is added only recently and in 1.43 it was not there. Why
was this method added?
line 328 - outputPostamble(lOut, mimePart, mp.getCount(), boundary); - the
mimePart is actually the same object as bodyPart, but in this method the Raw
Input Stream is read and the boundaries are counted. Although this multipart
has 4 parts only 4 boundaries are counted, but 5 are expected, which throws an
exception for a mismatch in the boundaries count. This happens because one of
the boundaries is not visible using the raw input stream. Because the third and
the fourth parts of the multipart are encrypted, while reading the input stream
it doesn't match the check if a line starts with a boundary, because the
boundary between these parts is also encrypted.
Please advise why was this line added there and is there a workaround for this
issue?
---
This was resolved by setting the property mail.mime.cachemultipart=false.
It seems that the cache mechanism is not working as required.
--
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.