Re: Bug #17966 [NEW]: Problem decoding E-Mails from Lotus Notes
| From: | Alan Knowles | Date: | Wed, 20 Oct 2010 06:21:42 +0000 |
| Subject: | Re: Bug #17966 [NEW]: Problem decoding E-Mails from Lotus Notes | ||
| References: | 1 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-5765@lists.php.net to get a copy of this message | ||
Bug system is playing up - I can't see this in the database at present.
This looks like rather a big kludge to solve this issue.. Once it's open, can you upload a sample email to the bug report so It's feasible to run a test case against it.
Regards
Alan
On Monday, October 18, 2010 03:32 AM, lucabert at lucabert dot de wrote:
From: #ae5b4b6056cfdc88f8fOperating system: Linux Debian 4.0 Package version: 1.5.4PHP version: 5.2.0 Package: Mail_mimeDecode Bug Type: BugBug description: Problem decoding E-Mails from Lotus Notes Description: ------------ By processing E-Mails coming from Lotus Notes (containing a boundary that ends with "=") the package cannot decode the body. I wrote a little Patch to correct this problem (simply deleting the "=" of the boundary in the whole E-Mail). --- /usr/share/php/Mail/mimeDecode.php 2010-09-14 07:24:30.000000000 +0200+++ mimeDecode.php 2010-10-17 20:24:21.000000000 +0200@@ -324,6 +324,12 @@$default_ctype = (strtolower($content_type['value'])=== 'multipart/digest') ? 'message/rfc822' : 'text/plain';+ if(preg_match('/=$/',$content_type['other']['boundary']) != 0)+ {+ $newBoundary = preg_replace('/=$/', '',$content_type['other']['boundary']);+ $body =str_replace($content_type['other']['boundary'], $newBoundary, $body);+ $content_type['other']['boundary'] = $newBoundary;+ }$parts = $this->_boundarySplit($body,$content_type['other']['boundary']);for ($i = 0; $i< count($parts); $i++) {list($part_header, $part_body) =$this->_splitBodyHeader($parts[$i]);