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

Bug #5730 Mail_MimeDecode: Incorrect Mail decode - no body
Submitted: 2005-10-20 04:44 UTC Modified: 2010-09-02 11:35 UTC
From: nicolas at isaveurs dot com Assigned:
Status: Suspended Package: Mail_mimeDecode
PHP Version: 5.0.5 OS:
Roadmaps: 1.6.0    
Subscription  


 [2005-10-20 04:44 UTC] 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[].

Comments

 [2006-03-06 04:36 UTC] 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.
 [2006-04-27 09:34 UTC] cipri (Cipriano Groenendal)
Moved to Mail_MimeDecode subpackage.
 [2010-09-02 11:35 UTC] alan_k (Alan Knowles)
-Status: Open +Status: Suspended
Needs test case