php.net |  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
 [2013-05-03 03:05 UTC] bill dot yang at watchguard dot com
Description:
------------
---
From manual page: http://www.php.net/function.mailparse-msg-parse-file#refsect1-function.mailparse-msg-parse-file-description
---
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
        mailparse_msg_free($mime);


        return $parts;
    }


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

Actual result:
--------------
There aren't mail address.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-07 14:46 UTC] cmb@php.net
-Package: *Mail Related +Package: mailparse
 [2020-12-07 14:49 UTC] cmb@php.net
-Status: Open +Status: Feedback -Type: Documentation Problem +Type: Bug -Assigned To: +Assigned To: cmb
 [2020-12-07 14:49 UTC] cmb@php.net
> 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] <http://sscce.org/>
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC