Re: [PEAR-BUG] Bug #17966 [NEW]: Problem decoding E-Mails from Lotus Notes
[email protected] (Alan Knowles)
| Newsgroups | php.pear.qa |
|---|---|
| Message-ID | <[email protected]> |
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: #ae5b4b6056cfdc88f8f
> Operating system: Linux Debian 4.0
> Package version: 1.5.4
> PHP version: 5.2.0
> Package: Mail_mimeDecode
> Bug Type: Bug
> Bug 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]);
>
>
>
>
>