Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.5

Bug #4585 Mail_MimeDecode: Mime boundary regex not taking simple quotes
Submitted: 2005-06-14 01:17 UTC Modified: 2010-09-02 11:34 UTC
From: cyril at ecomposite dot fr Assigned: alan_k
Status: Closed Package: Mail_mimeDecode
PHP Version: 4.3.11 OS: Irrelevant
Roadmaps: 1.6.0    

 [2005-06-14 01:17 UTC] cyril at ecomposite dot fr
Description: ------------ I have an email containing a simple quote as part of the boundary. Here's an abstract: Received: from ([] verified) by (CommuniGate Pro SMTP 4.2.4) with ESMTP id 190010 for; Tue, 07 Jun 2005 11:31:48 +0200 Received: from [] (unknown []) by (Postfix) with ESMTP id 2B4AA2BC018 for <>; Tue, 7 Jun 2005 04:30:46 -0500 (CDT) From: Reply-To: To: Subject: Date: Tue, 7 Jun 2005 11:31:50 +0200 Message-ID: <> X-Mailer: EPOC Email Version 2.10 MIME-Version: 1.0 Content-Language: i-default Content-Type: multipart/mixed; boundary="EPOC32-DJjQs,Tv1+- mt6_9tZd'vjYGTpL7nKjkm0lM9Wh02x7MrM3j" *This message was transferred with a trial version of CommuniGate(tm) Pro* This is a MIME Message --EPOC32-DJjQs,Tv1+-mt6_9tZd'vjYGTpL7nKjkm0lM9Wh02x7MrM3j Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable --EPOC32-DJjQs,Tv1+-mt6_9tZd'vjYGTpL7nKjkm0lM9Wh02x7MrM3j Content-Type: application/octet-stream Content-Disposition: attachment; filename="461M0022.jpg" Content-Transfer-Encoding: base64 /9j/4QGsRXhpZgAASUkqAAgAAAAKAA4BAgAgAAAAhgAAAA8BAgAOAAAApgAA ABABAgATAAAAtAAAABIBAwABAAAAAQAAABoBBQABAAAAyAAAABsBBQABAAAA 0AAAACgBAwABAAAAAgAAADIBAgAUAAAA2AAAABMCAwABAAAAAgAAAGmHBAAB cSR1GR0JzSt1AR+EAZufpUA+U8N2qRm5B7H8qCcsVC9O2MVW2wthhJAA4x9K aYycluDTvLOWZgcA4HFJjcMp261V7ahZob64BHtTQzBuOuOeD0pTkLls5z0z Sct06+nWnoNIUnDEk5B6cUjHp1APpQW7E4GO9ISu0AEYJoQdRWAdSCduOc5F RhfmwrZJpV2rn5uMYpUChsAnJ6EGnsJ6DG2nHpnk5oLHnOPYGnyMoJJ5z1wa jwpzuOD9Ka13JaDd04HFM5Gcg9etPI3LxnnpjmmkY+YdPrTVgshuC2DwMHmm tggjcSewFOkBZM5Az0xxTNmNrMwx35qg0P/Z Reproduce code: --------------- $params['include_bodies'] = true; $params['decode_bodies'] = true; $params['decode_headers'] = true; $params['input'] = $input; $structure = Mail_mimeDecode::decode($params); Irrelevant he? Expected result: ---------------- Without the simple quote in the boundary header, no error at all, the decode works fine and I have all parts of the email message. Actual result: -------------- I get 'No boundary found for ...' error message. So I guess I should modify the regex in parseheadervalue() unfortunately I cannot read or correct it: it is way too complicated for me.


 [2005-12-02 09:02 UTC] cm at data-consult dot de
look here please: i think thats the same problem.
 [2006-04-10 04:40 UTC] sebastian dot cristeanospam at bitnet dot info (Sebastian Cristea)
Not same as 5831, the following should fix it: Change line 454 in mimeDecode.php to: $splitRegex = '/([^;\'"]*[\'"]([^"]*([^\'"]*)*)[\'"][^;\'"]*|([^;]+))(;|$)/';
 [2006-04-27 09:34 UTC] cipri (Cipriano Groenendal)
Moved to Mail_MimeDecode subpackage.
 [2007-02-12 16:10 UTC] cellog (Greg Beaver)
contains analysis of fix needed, changing to "Analyzed"
 [2007-02-12 16:14 UTC] cellog (Greg Beaver)
fix in #5831
 [2007-02-12 16:18 UTC] cellog (Greg Beaver)
also see #9344 for test script email
 [2007-12-11 08:22 UTC] pr1001 (Peter Robinett)
Sebastian Cristea's regex string works for this: Content-Type: multipart/mixed; boundary="EPOC32-yJ_w,dYvdWJSqRm'Z9nzbFty,yNP'Qv94z+Vyt-Bks80,+Dx" I believe the code should be updated to use his regex string.
 [2010-09-02 11:34 UTC] alan_k (Alan Knowles)
-Status: Analyzed +Status: Closed -Assigned To: +Assigned To: alan_k
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at