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

Request #19961 Failure to parse [file]name*1*=utf-8''URL; [file]name*2*=URL
Submitted: 2013-05-29 00:33 UTC
From: randalla Assigned:
Status: Open Package: Mail_mimeDecode (version 1.5.5)
PHP Version: 5.3.23 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 32 - 28 = ?

 
 [2013-05-29 00:33 UTC] randalla (Adam Randall)
Description: ------------ This is related to #9616. I'm receiving e-mails from iCloud that contain long names, but they are in the format of: [file]name*1*=utf-8''%20%20%20%20; [file]name*2*=%20%20%20%20%20 Here's some relevant information: # print_r( $part->ctype_parameters ); Array ( [name*1*] => utf- 8%48%6F%75%73%65%20%49%6E%73%75%72%61 [name*2*] => %6E%63%65%2E%70%64%66 ) # print_r( $part->headers ); Array ( [content-id] => <35b9249a-1162-4ba3-ab6f- 1518661e1b61@icloud.com> [content-type] => application/pdf; name*1*=utf- 8''%48%6F%75%73%65%20%49%6E%73%75%72%61; name*2*=%6E%63%65%2E%70%64%66 [content-transfer-encoding] => base64 [content-disposition] => attachment; filename*1*=utf- 8''%48%6F%75%73%65%20%49%6E%73%75%72%61; filename*2*=%6E%63%65%2E%70%64%66 ) Not sure if it's necessary, but here's some sanitized headers: From somebody@me.com Sun May 26 08:41:34 2013 Return-Path: <nobody@me.com> X-Original-To: myaddress@here.com Delivered-To: myaddress@here.com Received: Received: X-Server-Uuid: Received: X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details: MIME-Version: 1.0 Received: To: myaddress@here.com From: "Somebody" <somebody@me.com> Subject: Their Subject Line #12345 Date: Sun, 26 May 2013 15:39:54 +0000 (GMT) X-Mailer: iCloud Mail (1Q) X-Originating-IP: Message-ID: <9978818f-2c21-4e00-8f0c- 094d6ec1c0e8@me.com> X-TMWD-Spam-Summary: X-MMS-Spam-Filter-ID: X-WSS-ID: Content-Type: multipart/alternative; boundary="Boundary_(ID_ZcR2Vul4mq27B0g0wvFLMg)" [snipped] --Boundary_(ID_AcW2oBwQSJ6m0TXXzf7xzw) Content-ID: <35b9249a-1162-4ba3-ab6f- 1518661e1b61@icloud.com> Content-Type: application/pdf; name*1*=utf- 8''%48%6F%75%73%65%20%49%6E%73%75%72%61; name*2*=%6E%63%65%2E%70%64%66 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*1*=utf- 8''%48%6F%75%73%65%20%49%6E%73%75%72%61; filename*2*=%6E%63%65%2E%70%64%66 I am running on Gentoo Linux. The PEAR versions are as follows: dev-php/PEAR-Mail 1.2.0 dev-php/PEAR-Mail_Mime 1.8.7 dev-php/PEAR-Mail_mimeDecode 1.5.5 Test script: --------------- <?php /* simple script to work around the issue */ $mime = "attachment; filename*1*=utf-8''%48%6F%75%73%65%20%49%6E%73%75%72%61; filename*2*=%6E%63%65%2E%70%64%66"; var_dump( preg_match_all( '/(?<=filename\*\d\*=)[^;]+(?=;|$)/', $mime, $matches ), urldecode( implode( '', $matches[0] ) ) ); ?> Expected result: ---------------- # print_r( $part->ctype_parameters ); Array ( [name] => House Insurance.pdf ) # print_r( $part->headers ); Array ( [content-id] => <35b9249a-1162-4ba3-ab6f- 1518661e1b61@icloud.com> [content-type] => application/pdf; name=House Insurance.pdf [content-transfer-encoding] => base64 [content-disposition] => attachment; filename=House Insurance.pdf ) Actual result: -------------- # print_r( $part->ctype_parameters ); Array ( [name*1*] => utf- 8%48%6F%75%73%65%20%49%6E%73%75%72%61 [name*2*] => %6E%63%65%2E%70%64%66 ) # print_r( $part->headers ); Array ( [content-id] => <35b9249a-1162-4ba3-ab6f- 1518661e1b61@icloud.com> [content-type] => application/pdf; name*1*=utf- 8''%48%6F%75%73%65%20%49%6E%73%75%72%61; name*2*=%6E%63%65%2E%70%64%66 [content-transfer-encoding] => base64 [content-disposition] => attachment; filename*1*=utf- 8''%48%6F%75%73%65%20%49%6E%73%75%72%61; filename*2*=%6E%63%65%2E%70%64%66 )

Comments

 [2013-07-04 18:39 UTC] alan_k (Alan Knowles)
needs a patch.