FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17325&edit=1

ID: 17325
Updated by: hirakawa@ba-z.co.jp
Reported By: hirakawa at ba-z dot co dot jp
Summary: Can't parse messages without a blank line
Status: Open
Type: Bug
Package: Mail_mimeDecode
Operating System: Linux
Package Version: 1.5.1
PHP Version: 5.2.12
Roadmap Versions:
New Comment:

Sorry, the script is a little wrong:

<?php

require_once 'mimeDecode.php';

$with_blank = <<<WITH_BLANK
Date: Tue, 20 Apr 2010 13:19:50 +0900
From: Goichi Hirakawa <hirakawa@ba-z.co.jp>
To: Goichi Hirakawa <hirakawa@ba-z.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


WITH_BLANK;

$without_blank = <<<WITHOUT_BLANK
Date: Tue, 20 Apr 2010 13:19:50 +0900
From: Goichi Hirakawa <hirakawa@ba-z.co.jp>
To: Goichi Hirakawa <hirakawa@ba-z.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
WITHOUT_BLANK;

$params = array(
'input' => $with_blank,
'include_bodies' => true,
'decode_bodies' => true,
'decode_headers' => true,
'rfc_822bodies' => true
);
$structure = Mail_mimeDecode::decode($params);
var_dump($structure);

$params = array(
'input' => $without_blank,
'include_bodies' => true,
'decode_bodies' => true,
'decode_headers' => true,
'rfc_822bodies' => true
);
$structure = Mail_mimeDecode::decode($params);
var_dump($structure);

?>


Previous Comments:
------------------------------------------------------------------------

[2010-04-20 06:14:11] hirakawa

Added #patch bug:17325;patch:Mail_Mime.diff;revision:1271744051;.

------------------------------------------------------------------------

[2010-04-20 06:09:30] hirakawa

Description:
------------
_splitBodyHeader() can't parse messages without a blank line.
According to RFC 5322, "CRLF body" is optional in message:

message = (fields / obs-fields)
[CRLF body]


Test script:
---------------
<?php

require_once 'mimeDecode.php';

$with_blank = <<<WITH_BLANK
Date: Tue, 20 Apr 2010 13:19:50 +0900
From: Goichi Hirakawa <hirakawa@ba-z.co.jp>
To: Goichi Hirakawa <hirakawa@ba-z.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

WITH_BLANK;

$without_blank = <<<WITHOUT_BLANK
Date: Tue, 20 Apr 2010 13:19:50 +0900
From: Goichi Hirakawa <hirakawa@ba-z.co.jp>
To: Goichi Hirakawa <hirakawa@ba-z.co.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
WITHOUT_BLANK;

$params = array(
'input' => $with_blank,
'include_bodies' => true,
'decode_bodies' => true,
'decode_headers' => true,
'rfc_822bodies' => true
);
$structure = Mail_mimeDecode::decode($params);
var_dump($structure);

$params = array(
'input' => $without_blank,
'include_bodies' => true,
'decode_bodies' => true,
'decode_headers' => true,
'rfc_822bodies' => true
);
$structure = Mail_mimeDecode::decode($params);
var_dump($structure);

?>


Expected result:
----------------
Results of var_dump() are equal.

Actual result:
--------------
Results of var_dump() are NOT equal.

------------------------------------------------------------------------

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 3 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedApr 20, '10 at 5:35a
activeApr 21, '10 at 5:15a
posts3
users2
websitepear.php.net

2 users in discussion

Hirakawa: 2 posts Alan: 1 post

People

Translate

site design / logo © 2022 Grokbase