PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Mail » Mail_mimeDecode » Bug #5730

Mail_MimeDecode: Incorrect Mail decode - no body

Details

Submitted2005-10-20 09:44 UTC
Fromnicolas at isaveurs dot com
StatusSuspended
PackageMail_mimeDecode
PHP Version5.0.5
Roadmaps1.6.0

Comments

[2005-10-20 09: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[].