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
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 — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
30 + 25 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 25 12:01:31 2024 UTC