php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65680 imap_headerinfo: Value of reply_toaddress when reply-to is empty in mail header
Submitted: 2013-09-16 14:06 UTC Modified: 2020-10-16 15:27 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: walter at x5 dot nu Assigned: cmb (profile)
Status: Closed Package: IMAP related
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
23 - 8 = ?
Subscribe to this entry?

 
 [2013-09-16 14:06 UTC] walter at x5 dot nu
Description:
------------
PHP5.3.3-7
Debian 6.0

If the email header does not contain a reply-to field, then the function imap_headerinfo() returns the value of the email header field 'Return-Path' instead of an empty string in the field [reply_toaddress]

Example:
This is the relevant header info of the mail in the inbox

From x@example.com  Mon Sep 16 15:42:06 2013
Return-Path: <x@example.com>
X-Original-To: y@example.com
Delivered-To: y@example.com
X-IMP-FROM: _________<x@example.com>
X-IMP-AUTH_USERNAME: <x@example.com>
X-Original-IP: 12.34.56.78
Message-ID: <52370AA4.7050108@example.com>
Date: Mon, 16 Sep 2013 15:41:56 +0200
From: x <x@example.com>
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130803 Thunderbird/17.0.8
MIME-Version: 1.0
To: y@example.com
Subject: Test
X-Enigmail-Version: 1.4.6
Content-Type: multipart/mixed;
 boundary="------------020508080209090708030903"

This is a multi-part message in MIME format.
--------------020508080209090708030903
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
...

Using the PHP function
$headerInfo = imap_headerinfo($mbox, $overview->msgno); print_r($headerInfo);

results in:

stdClass Object
(
    [date] => Mon, 16 Sep 2013 15:41:56 +0200
    [Date] => Mon, 16 Sep 2013 15:41:56 +0200
    [subject] => Test
    [Subject] => Test
    [message_id] => <52370AA4.7050108@example.com>
    [toaddress] => y@example.com
    [to] => Array
        (
            [0] => stdClass Object
                (
                    [mailbox] => y
                    [host] => example.com
                )

        )

    [fromaddress] => x <x@example.com>
    [from] => Array
        (
            [0] => stdClass Object
                (
                    [personal] => x
                    [mailbox] => x
                    [host] => example.com
                )

        )

    [reply_toaddress] => x <x@example.com>
    [reply_to] => Array
        (
            [0] => stdClass Object
                (
                    [personal] => x
                    [mailbox] => x
                    [host] => example.com
                )

        )

    [senderaddress] => x <x@example.com>
    [sender] => Array
        (
            [0] => stdClass Object
                (
                    [personal] => x
                    [mailbox] => x
                    [host] => example.com
                )

        )

    [Recent] => N
    [Unseen] =>  
    [Flagged] =>  
    [Answered] =>  
    [Deleted] =>  
    [Draft] =>  
    [Msgno] =>    1
    [MailDate] => 16-Sep-2013 15:41:56 +0200
    [Size] => 24400
    [udate] => 1379338916
)

Test script:
---------------
Sent an email without reply to header to target server
On target server used:
$headerInfo = imap_headerinfo($mbox, $overview->msgno); print_r($headerInfo);

As a result
$headerInfo->reply_toaddress is not empty, but contains value of 'Return-Path' from email header


Expected result:
----------------
In the above example I would expect an empty string in $headerInfo->reply_toaddress

Actual result:
--------------
$headerInfo->reply_toaddress contains the value of 'Return-Path' from the email header

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-10-16 15:27 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-10-16 15:27 UTC] cmb@php.net
The reply_toaddress field is provided by libc-client; there is
nothing we can do about it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 15:01:29 2024 UTC