Home » Mail » Mail_Mime » Bug #7484
Mail_Mimedecode: Fails to identify filename
Details
| Submitted | 2006-04-25 12:30 UTC |
|---|---|
| From | phoebebright at spamcop dot net |
| Assigned | cipri |
| Status | Bogus |
| Package | Mail_Mime |
| PHP Version | 4.3.8 |
| OS | Redhat |
| Roadmaps | (Not assigned) |
Comments
[2006-04-25 12:30 UTC] phoebebright at spamcop dot net
Description:
------------
I am writing software that processes mail using the php pear class mimemail. This software is unable to processes a mail sent using Mac mail that contains a word attachement where the word attachement has an image in the header. Obscure I know! I don't know if this is a Mac Mail problem or a Pear problem, but I am posting to both to try and resolve. Here is a segment of the mail for a word document with no image in the header
To: acc@vividlogic.ie
Message-Id: <E6CC64F1-961F-47B6-AFBE-85A15B283B11@spamcop.net>
Content-Type: multipart/mixed; boundary=Apple-Mail-34-155945456
From: Phoebe Bright <phoebebright@spamcop.net>
Subject: test
Date: Tue, 25 Apr 2006 13:07:49 +0100
X-Mailer: Apple Mail (2.746.2)
--Apple-Mail-34-155945456
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
amount:99
--Apple-Mail-34-155945456
Content-Transfer-Encoding: base64
Content-Type: application/octet-stream;
x-mac-type=5738424E;
x-unix-mode=0644;
x-mac-creator=4D535744;
name="testnoimage.doc"
Content-Disposition: attachment;
filename=testnoimage.doc
0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAOQAAAAAAAAAA
EAAAOwAAAAEAAAD+////AAAAADgAAAD/////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
And here is the version with the image.
Mime-Version: 1.0 (Apple Message framework v746.2)
To: acc@vividlogic.ie
Message-Id: <BD454ADD-6C22-4D62-880E-3B2AA0DC8540@spamcop.net>
Content-Type: multipart/mixed; boundary=Apple-Mail-32-155122976
From: Phoebe Bright <phoebebright@spamcop.net>
Subject: testvbad
Date: Tue, 25 Apr 2006 12:54:07 +0100
X-Mailer: Apple Mail (2.746.2)
--Apple-Mail-32-155122976
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
amount:99
--Apple-Mail-32-155122976
Content-Type: multipart/appledouble;
boundary=Apple-Mail-33-155122979
Content-Disposition: attachment
--Apple-Mail-33-155122979
Content-Transfer-Encoding: base64
Content-Type: application/applefile;
name="PF010.doc"
Content-Disposition: attachment;
filename=PF010.doc
AAUWBwACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAJAAAAPgAAAAoAAAADAAAASAAAAAkAAAACAAAA
UQAAAURXOEJOTVNXRAAAUEYwMTAuZG9jAAABAAAAARIAAAASAAAAMgAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Test script:
---------------
I can send a copy of the mail causing a problem if this would help.
require_once 'Mail/mimeDecode.php';
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$decoder = new Mail_mimeDecode($email_data);
$email = $decoder->decode($params);
Expected result:
----------------
The attachement is not processed because mimeDecode does not identify the filename. This is the array $email where there is no image in the word doc.
[parts] => Array
(
[0] => stdClass Object
(
[headers] => Array
(
[content-transfer-encoding] => 7bit
[content-type] => text/plain; charset=US-ASCII; format=flowed
)
[ctype_primary] => text
[ctype_secondary] => plain
[ctype_parameters] => Array
(
[charset] => US-ASCII
[format] => flowed
)
[body] => amount:99
)
[1] => stdClass Object
(
[headers] => Array
(
[content-transfer-encoding] => base64
[content-type] => application/octet-stream; x-mac-type=5738424E; x-unix-mode=0644; x-mac-creator=4D535744; name="testnoimage.doc"
[content-disposition] => attachment; filename=testnoimage.doc
)
[ctype_primary] => application
[ctype_secondary] => octet-stream
[ctype_parameters] => Array
(
[x-mac-type] => 5738424E
[x-unix-mode] => 0644
[x-mac-creator] => 4D535744
[name] => testnoimage.doc
)
[disposition] => attachment
[d_parameters] => Array
(
[filename] => testnoimage.doc
)
[body] => KKKK
Actual result:
--------------
This is the one with the image:
[parts] => Array
(
[0] => stdClass Object
(
[headers] => Array
(
[content-transfer-encoding] => 7bit
[content-type] => text/plain; charset=US-ASCII; format=flowed
)
[ctype_primary] => text
[ctype_secondary] => plain
[ctype_parameters] => Array
(
[charset] => US-ASCII
[format] => flowed
)
[body] => amount:99
)
[1] => stdClass Object
(
[headers] => Array
(
[content-type] => multipart/appledouble; boundary=Apple-Mail-33-155122979
[content-disposition] => attachment
)
[ctype_primary] => multipart
[ctype_secondary] => appledouble
[ctype_parameters] => Array
(
[boundary] => Apple-Mail-33-155122979
)
[disposition] => attachment
[body] =>
--Apple-Mail-33-155122979
Content-Transfer-Encoding: base64
Content-Type: application/applefile;
name="PF010.doc"
Content-Disposition: attachment;
filename=PF010.doc
AAUWBwACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAJAAAAPgAAAAoAAAADAAAASAAAAAkAAAACAAAA
UQAAAURXOEJOTVNXRAAAUEYwMTAuZG9jAAABAAAAARIAAAASAAAAMgAAAAAAAAAAAAAAAAAAAAAA