Bug #69087 [Opn->Nab]: imap_headerinfo wrong parse fromaddress header
| From: | cmb@php.net | Date: | Sat, 29 Aug 2015 11:47:44 +0000 |
| Subject: | Bug #69087 [Opn->Nab]: imap_headerinfo wrong parse fromaddress header | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-195629@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=69087&edit=1
ID: 69087
Updated by: cmb@php.net
Reported by: piotroo89 at gmail dot com
Summary: imap_headerinfo wrong parse fromaddress header
-Status: Open
+Status: Not a bug
Type: Bug
Package: IMAP related
Operating System: Debian/Ubuntu
PHP Version: 5.4.38
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The From header field of this email is not valid according to RFC
2822[1]. Therefore it is ignored by imap_headerinfo(), what I
don't consider a bug.
[1] <http://tools.ietf.org/html/rfc2822#section-3.6.2>
Previous Comments:
------------------------------------------------------------------------
[2015-02-20 09:12:23] piotroo89 at gmail dot com
Description:
------------
Debian GNU/Linux 7 - PHP 5.4.36-0+deb7u3
Ubuntu 14.10 - PHP 5.5.12-2ubuntu4.2
Problem with parse imap headers from mailer delivery daemon. Header from isn't properly handled
in case when mail came form mailer daemon.
Test script:
---------------
This is mail:
Delivered-To: addr@foo.bar
Received: by 10.64.25.193 with SMTP id e1csp360082ieg;
Wed, 18 Feb 2015 23:21:19 -0800 (PST)
X-Received: by 10.180.73.241 with SMTP id o17mr7637081wiv.16.1424330476433;
Wed, 18 Feb 2015 23:21:16 -0800 (PST)
Return-Path: <>
Received: from antyspam.addr@bar.baz (smtp.addr@bar.baz. [0.0.0.0])
by mx.google.com with ESMTPS id ft7si39444898wjb.169.2015.02.18.23.21.15
for <addr@foo.bar>
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Wed, 18 Feb 2015 23:21:16 -0800 (PST)
Received-SPF: none (google.com: antyspam.addr@bar.baz does not designate permitted sender hosts)
client-ip=0.0.0.0;
Authentication-Results: mx.google.com;
spf=none (google.com: antyspam.addr@bar.baz does not designate permitted sender hosts)
smtp.mail=
Received: by antyspam.addr@bar.baz (Spam Firewall)
id 40635119E0BB; Thu, 19 Feb 2015 08:21:15 +0100 (CET)
Date: Thu, 19 Feb 2015 08:21:15 +0100 (CET)
From: MAILER-DAEMON (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
$result = imap_headerinfo($, 1);
Expected result:
----------------
stdClass Object
(
[date] => Thu, 19 Feb 2015 08:21:15 +0100 (CET)
[Date] => Thu, 19 Feb 2015 08:21:15 +0100 (CET)
[subject] => Undelivered Mail Returned to Sender
[Subject] => Undelivered Mail Returned to Sender
[message_id] => <20150219072115.40635119E0BB@antyspam.foo.foo>
[fromaddress] => MAILER-DAEMON
[toaddress] => addr@foo.bar
[to] => Array
(
[0] => stdClass Object
(
[mailbox] => addr
[host] => foo.bar
)
)
[Recent] =>
[Unseen] => U
[Flagged] =>
[Answered] =>
[Deleted] =>
[Draft] =>
[Msgno] => 752
[MailDate] => 20-Feb-2015 08:20:13 +0000
[Size] => 23704
[udate] => 1424420413
)
Actual result:
--------------
stdClass Object
(
[date] => Thu, 19 Feb 2015 08:21:15 +0100 (CET)
[Date] => Thu, 19 Feb 2015 08:21:15 +0100 (CET)
[subject] => Undelivered Mail Returned to Sender
[Subject] => Undelivered Mail Returned to Sender
[message_id] => <20150219072115.40635119E0BB@antyspam.foo.foo>
[toaddress] => addr@foo.bar
[to] => Array
(
[0] => stdClass Object
(
[mailbox] => addr
[host] => foo.bar
)
)
[Recent] =>
[Unseen] => U
[Flagged] =>
[Answered] =>
[Deleted] =>
[Draft] =>
[Msgno] => 752
[MailDate] => 20-Feb-2015 08:20:13 +0000
[Size] => 23704
[udate] => 1424420413
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69087&edit=1