|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64768 mail parser can't get total contents of "From" and "To"
Submitted: 2013-05-03 03:05 UTC Modified: 2020-12-20 04:22 UTC
From: bill dot yang at watchguard dot com Assigned: cmb (profile)
Status: No Feedback Package: mailparse (PECL)
PHP Version: 5.5.0beta4 OS: freebsd 7.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bill dot yang at watchguard dot com
New email:
PHP Version: OS:


 [2013-05-03 03:05 UTC] bill dot yang at watchguard dot com
From manual page:
I use php5 pcre.
I don't know the reason, perhaps it's because configure of mail parse.

Test script:
    function _process_mail_file($qfile)
        // parse the message and return a mime message resource
        $mime = mailparse_msg_parse_file($qfile);
        // get message structure
        $struct = mailparse_msg_get_structure($mime);
        // get message parts based on message structure
        $parts = array();
        foreach ($struct as $part_id) {
            $part = mailparse_msg_get_part($mime, $part_id);
//Following line when print_r($parts[$part_id]); the mail header "From" and "To" contents just have user name, don't have email address. 
            $parts[$part_id] = mailparse_msg_get_part_data($part);


        // free mime resource

        return $parts;

Expected result:
have email address for "From" and "To"

Actual result:
There aren't mail address.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-07 14:46 UTC]
-Package: *Mail Related +Package: mailparse
 [2020-12-07 14:49 UTC]
-Status: Open +Status: Feedback -Type: Documentation Problem +Type: Bug -Assigned To: +Assigned To: cmb
 [2020-12-07 14:49 UTC]
> I don't know the reason, perhaps it's because configure of mail parse.

Maybe.  Maybe it is because $qfile is empty, corrupt or whatever.
Please provide a reproducible example[1].

[1] <>
 [2020-12-20 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Jan 21 03:01:23 2021 UTC