Bug #5730 [Opn->Sus]: Mail_MimeDecode: Incorrect Mail decode - no body

From: Date: Thu, 02 Sep 2010 12:35:53 +0000
Subject: Bug #5730 [Opn->Sus]: Mail_MimeDecode: Incorrect Mail decode - no body
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-4737@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=5730&edit=1 ID: 5730 Updated by: alan@akbkhome.com Reported By: nicolas at isaveurs dot com Summary: Mail_MimeDecode: Incorrect Mail decode - no body -Status: Open +Status: Suspended Type: Bug Package: Mail_mimeDecode PHP Version: 5.0.5 Roadmap Versions: New Comment: -Status: Open +Status: Suspended Needs test case Previous Comments: ------------------------------------------------------------------------ [2006-04-27 10:34:56] cipri Moved to Mail_MimeDecode subpackage. ------------------------------------------------------------------------ [2006-03-06 04:36:53] toggg It can occur when last boundary is missing (truncated message) Please find the material there: http://toggg.com/pear/Mail_Mime/ # php test.php ok shows the unique part within the multipart. # php test.php 5730 forget this part as the message is not correct, missing last boundary. Hacking mimeDecode.php as shown here actually gives a body, but truncated, so only good for trash. ------------------------------------------------------------------------ [2005-10-20 05:44:54] nicolas at isaveurs dot com Description: ------------ Incorrect Mail Decode. Decoder unable to give back the body of a multipart mail message when there is only one part. Test script: --------------- $thisMessage=file_get_contents('http://www.isaveurs.com/tmp/tst.html'); $params['include_bodies'] = TRUE; $params['decode_bodies'] = TRUE; $params['decode_headers'] = TRUE; $decoder = new Mail_mimeDecode($thisMessage); $messStruct = $decoder->decode($params); // messStruct will have no parts[]. ?? Patch ?? line 503 in mimeDecode::_boundarySplit for ($i = 1; $i < count($tmp)-1 ; $i++) { should be for ($i = 1; $i < count($tmp) ; $i++) { Clearly, it works with this code in this special case - haven't tested it with other mails samples to see any side effect. Expected result: ---------------- $messStruct should have one parts[]. Actual result: -------------- messStruct will has no parts[]. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=5730&edit=1

« previous php.pear.bugs (#4737) next »