|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58108 works with latest CVS
Submitted: 2008-03-19 09:29 UTC Modified: 2008-04-08 14:21 UTC
From: robbie dot wilhelm at gmail dot com Assigned:
Status: Closed Package: mailparse (PECL)
PHP Version: 5.2.6 OS: gentoo
Private report: No CVE-ID: None
 [2008-03-19 09:29 UTC] robbie dot wilhelm at gmail dot com
crash occurs, when parsing certain emails, and accessing the header. print_r (also var_dump) gives output like this:
    [return-path] => <>
    [delivered-to] =>
    [received] => Array
Segmentation fault

I am able to access 'return-path', 'date' etc. but on 'received' it will crash.

my workaround is to use iconv_mime_decode_headers() on a separat header string.

after more investigation... this crash happens only when mailparse functions are used in function or method context. strange...

Reproduce code:
function my_mime_parse($file){
   return $hdrs;


Return-Path: <>
Received: from localhost (localhost [])
        by (Postfix) with SMTP id B12588E1D9
        for <>; Thu, 24 Jan 2008 01:01:46 +0100 (CET)
Received: from ( [])
        by (Postfix) with ESMTP id 77CC08E69E
        for <>; Thu, 24 Jan 2008 01:01:40 +0100 (CET)
Received: from localhost (localhost [])
        by (Postfix) with ESMTP id 1280C3692A6
        for <>; Thu, 24 Jan 2008 01:01:47 +0100 (CET)
X-Amavis-Hold: Maximum number of files (1500) exceeded at (eval 71) line 1264,
        <GEN137> line 1501.
Received: by (Postfix, from userid 1000)
        id A3CD63B1EFB; Thu, 24 Jan 2008 01:01:35 +0100 (CET)
Date: Thu, 24 Jan 2008 01:01:34 +0100
From: Roger Rabbit <>
Subject: pix(es)
Message-ID: <>
MIME-Version: 1.0
User-Agent: Mutt/1.5.16 (2007-06-09)
X-DSPAM-Result: Innocent
X-DSPAM-Processed: Thu Jan 24 01:01:46 2008
X-DSPAM-Confidence: 0.9899
X-DSPAM-Probability: 0.0000
X-DSPAM-Signature: 4797d56a112601598781208
Content-Type: multipart/mixed; boundary=DSPAM_MULTIPART_EX-11260

Hi R,

schlappe 13MB sollten euren Mailserver doch nicht sprengen, oder?



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-19 10:08 UTC] robbie dot wilhelm at gmail dot com
had this crash with php v 5.2.5 and now with gentoo version 5.2.6 too...
 [2008-03-23 21:56 UTC]
I can reproduce with mailparse-2.1.3, but not with the latest CVS version.  Can you please try out the latest CVS and report your results?
 [2008-04-08 13:45 UTC] robbie dot wilhelm at gmail dot com
Yes. finally I could try the CVS version. and it works! thank 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 19:01:29 2024 UTC