Ticket #238 (closed Bugs: fixed)
Unable to read messages with semicolons after the last parameter of a header value (POP)
|Reported by:||octo||Owned by:||octo|
This is another strange MIMEInputStream bug that appears to exist in OS 4.5 through 5.0, but has been fixed in OS 6.0.
The following raw message will completely fail to return any content parts when parsed through MIMEInputStream:
Date: Thu, 22 Jul 2010 14:42:52 -0700 (PDT) From: Test <firstname.lastname@example.org> To: User <email@example.com> Subject: Test message Content-Transfer-Encoding: 8BIT Content-Type: multipart/mixed; boundary="-----O77SH13D170413020610"; charset=utf-8 -------O77SH13D170413020610 Content-Type: text/plain; charset=utf-8; Content-Transfer-Encoding: quoted-printable This is some text -------O77SH13D170413020610--
In this case, the issue appears to be the parameters on the "Content-Type" header within the text/plain section. If the semicolon following the last parameter is removed, then MIMEInputStream will successfully return the content.
The safest workaround will probably involve finding all the message headers, both at the beginning and within the actual body parts, and trimming any trailing semicolons. (will need testing to see if this just affects "Content-Type", or also affects other fields.