Bug #67207 [NEW]: imap_headerinfo bug for utf8-encoded "from" header field

From: Date: Mon, 05 May 2014 11:20:32 +0000
Subject: Bug #67207 [NEW]: imap_headerinfo bug for utf8-encoded "from" header field
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-185629@lists.php.net to get a copy of this message
From: e dot lemanissier at physioflow dot com Operating system: PHP version: 5.4.28 Package: IMAP related Bug Type: Bug Bug description:imap_headerinfo bug for utf8-encoded "from" header field Description: ------------ When using the imap_headerinfo on an email with an utf8 encoded from header (for example =?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?), the returned variable does not have any from field. The from information is however available if imap_rfc822_parse_headers(imap_fetchheader()) is used. Test script: --------------- var_dump(imap_headerinfo($this->mbox, $mid)); var_dump(imap_fetchheader($this->mbox, $mid)); var_dump(imap_rfc822_parse_headers(imap_fetchheader($this->mbox, $mid))); Expected result: ---------------- object(stdClass)#22 (17) { ["date"]=> string(31) "Fri, 11 Apr 2014 03:27:57 +0100" ["Date"]=> string(31) "Fri, 11 Apr 2014 03:27:57 +0100" ["subject"]=> string(72) "Rapport quotidien du dossier Spam du compte email support@XXX.com" ["Subject"]=> string(72) "Rapport quotidien du dossier Spam du compte email support@XXX.com" ["message_id"]=> string(46) "<0MRpI7-1WRWOS48ML-00Skij@spamreport.1and1.fr>" ["toaddress"]=> string(22) "support@XXX.com" ["to"]=> array(1) { [0]=> object(stdClass)#26 (2) { ["mailbox"]=> string(7) "support" ["host"]=> string(14) "XXX.com" } } ["fromaddress"]=> string(69) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=@UNKNOWN" ["from"]=> array(1) { [0]=> object(stdClass)#29 (2) { ["mailbox"]=> string(61) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=" ["host"]=> string(7) "UNKNOWN" } } ["Recent"]=> string(1) " " ["Unseen"]=> string(1) " " ["Flagged"]=> string(1) " " ["Answered"]=> string(1) " " ["Deleted"]=> string(1) " " ["Draft"]=> string(1) " " ["Msgno"]=> string(4) " 1" ["MailDate"]=> string(26) "11-Apr-2014 01:27:57 +0000" ["Size"]=> string(3) "922" ["udate"]=> int(1397179677) } string(655) "Return-Path: <> Delivery-Date: Fri, 11 Apr 2014 03:27:57 +0100 Received: from spamreport by localhost id 0MRpI7-1WRWOS48ML-00Skij for support@XXX.com (mailbox m51559649-71621086); Fri, 11 Apr 2014 03:27:57 +0100 From: =?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?= Subject: Rapport quotidien du dossier Spam du compte email support@XXX.com Date: Fri, 11 Apr 2014 03:27:57 +0100 To: <support@XXX.com> Message-Id: <0MRpI7-1WRWOS48ML-00Skij@spamreport.1and1.fr> Envelope-To: support@XXX.com MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable " object(stdClass)#27 (13) { ["date"]=> string(31) "Fri, 11 Apr 2014 03:27:57 +0100" ["Date"]=> string(31) "Fri, 11 Apr 2014 03:27:57 +0100" ["subject"]=> string(72) "Rapport quotidien du dossier Spam du compte email support@XXX.com" ["Subject"]=> string(72) "Rapport quotidien du dossier Spam du compte email support@XXX.com" ["message_id"]=> string(46) "<0MRpI7-1WRWOS48ML-00Skij@spamreport.1and1.fr>" ["toaddress"]=> string(22) "support@XXX.com" ["to"]=> array(1) { [0]=> object(stdClass)#28 (2) { ["mailbox"]=> string(7) "support" ["host"]=> string(14) "XXX.com" } } ["fromaddress"]=> string(69) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=@UNKNOWN" ["from"]=> array(1) { [0]=> object(stdClass)#29 (2) { ["mailbox"]=> string(61) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=" ["host"]=> string(7) "UNKNOWN" } } ["reply_toaddress"]=> string(69) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=@UNKNOWN" ["reply_to"]=> array(1) { [0]=> object(stdClass)#30 (2) { ["mailbox"]=> string(61) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=" ["host"]=> string(7) "UNKNOWN" } } ["senderaddress"]=> string(69) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=@UNKNOWN" ["sender"]=> array(1) { [0]=> object(stdClass)#31 (2) { ["mailbox"]=> string(61) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=" ["host"]=> string(7) "UNKNOWN" } } } Actual result: -------------- object(stdClass)#22 (17) { ["date"]=> string(31) "Fri, 11 Apr 2014 03:27:57 +0100" ["Date"]=> string(31) "Fri, 11 Apr 2014 03:27:57 +0100" ["subject"]=> string(72) "Rapport quotidien du dossier Spam du compte email support@XXX.com" ["Subject"]=> string(72) "Rapport quotidien du dossier Spam du compte email support@XXX.com" ["message_id"]=> string(46) "<0MRpI7-1WRWOS48ML-00Skij@spamreport.1and1.fr>" ["toaddress"]=> string(22) "support@XXX.com" ["to"]=> array(1) { [0]=> object(stdClass)#26 (2) { ["mailbox"]=> string(7) "support" ["host"]=> string(14) "XXX.com" } } ["Recent"]=> string(1) " " ["Unseen"]=> string(1) " " ["Flagged"]=> string(1) " " ["Answered"]=> string(1) " " ["Deleted"]=> string(1) " " ["Draft"]=> string(1) " " ["Msgno"]=> string(4) " 1" ["MailDate"]=> string(26) "11-Apr-2014 01:27:57 +0000" ["Size"]=> string(3) "922" ["udate"]=> int(1397179677) } string(655) "Return-Path: <> Delivery-Date: Fri, 11 Apr 2014 03:27:57 +0100 Received: from spamreport by localhost id 0MRpI7-1WRWOS48ML-00Skij for support@XXX.com (mailbox m51559649-71621086); Fri, 11 Apr 2014 03:27:57 +0100 From: =?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?= Subject: Rapport quotidien du dossier Spam du compte email support@XXX.com Date: Fri, 11 Apr 2014 03:27:57 +0100 To: <support@XXX.com> Message-Id: <0MRpI7-1WRWOS48ML-00Skij@spamreport.1and1.fr> Envelope-To: support@XXX.com MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable " object(stdClass)#27 (13) { ["date"]=> string(31) "Fri, 11 Apr 2014 03:27:57 +0100" ["Date"]=> string(31) "Fri, 11 Apr 2014 03:27:57 +0100" ["subject"]=> string(72) "Rapport quotidien du dossier Spam du compte email support@XXX.com" ["Subject"]=> string(72) "Rapport quotidien du dossier Spam du compte email support@XXX.com" ["message_id"]=> string(46) "<0MRpI7-1WRWOS48ML-00Skij@spamreport.1and1.fr>" ["toaddress"]=> string(22) "support@XXX.com" ["to"]=> array(1) { [0]=> object(stdClass)#28 (2) { ["mailbox"]=> string(7) "support" ["host"]=> string(14) "XXX.com" } } ["fromaddress"]=> string(69) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=@UNKNOWN" ["from"]=> array(1) { [0]=> object(stdClass)#29 (2) { ["mailbox"]=> string(61) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=" ["host"]=> string(7) "UNKNOWN" } } ["reply_toaddress"]=> string(69) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=@UNKNOWN" ["reply_to"]=> array(1) { [0]=> object(stdClass)#30 (2) { ["mailbox"]=> string(61) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=" ["host"]=> string(7) "UNKNOWN" } } ["senderaddress"]=> string(69) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=@UNKNOWN" ["sender"]=> array(1) { [0]=> object(stdClass)#31 (2) { ["mailbox"]=> string(61) "=?utf-8?q?D=C3=A9tection_de_spam_=3Cnoreply=401and1=2Efr=3E?=" ["host"]=> string(7) "UNKNOWN" } } } -- Edit bug report at https://bugs.php.net/bug.php?id=67207&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67207&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67207&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67207&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=67207&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=67207&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=67207&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=67207&r=needscript Try newer version: https://bugs.php.net/fix.php?id=67207&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=67207&r=support Expected behavior: https://bugs.php.net/fix.php?id=67207&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=67207&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=67207&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=67207&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67207&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=67207&r=dst IIS Stability: https://bugs.php.net/fix.php?id=67207&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=67207&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=67207&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=67207&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=67207&r=mysqlcfg

« previous php.bugs (#185629) next »