php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68275 Mailparse breaks with certain malformed emails
Submitted: 2014-10-21 13:58 UTC Modified: -
Votes:4
Avg. Score:3.0 ± 0.7
Reproduced:1 of 2 (50.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: niko at designosis dot com Assigned:
Status: Open Package: mailparse (PECL)
PHP Version: 5.4.34 OS: Centos
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:
Package:
Bug Type:
Summary:
From: niko at designosis dot com
New email:
PHP Version: OS:

 

 [2014-10-21 13:58 UTC] niko at designosis dot com
Description:
------------
I just tested Mailparse on ~1 million emails. Just under 1% fail to be parsed correctly. For example, the following email sent from Swedish Microsoft Windows Live (2009):

From testsender@test.com Tue Oct 21 15:36:14 2014
Received: from smtp-out21.han.skanova.net ([195.67.226.208]:46745)
	by testo.testotesto.com with esmtp (Exim 4.82)
	(envelope-from <testsender@test.com>)
	id 1XgZbh-0006gK-4R
	for info@testsite.com; Tue, 21 Oct 2014 15:36:14 +0200
Received: from acerDator (81.230.87.18) by smtp-out21.han.skanova.net (8.5.142.07) (authenticated as u50507056)
        id 5435C406005B5E47 for info@testsite.com; Tue, 21 Oct 2014 15:36:13 +0200
Message-ID: <EF7FD7F6E8964FCAB62A6783BCE9EC51@acerDator>
From: =?iso-8859-1?Q?testsender=E4ger?= <testsender@test.com>
To: <info@testsite.com>
Subject: test
Date: Tue, 21 Oct 2014 15:36:09 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_000_0017_01CFED44.BCBD5F00"
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Mailer: Microsoft Windows Live Mail 14.0.8117.416
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416
X-Spam-Status: No, score=-0.7
X-Spam-Score: -6
X-Spam-Bar: /
X-Spam-Flag: NO

Det här är ett flerdelat meddelande i MIME-format.

------=_NextPart_000_001D_01CFED44.CD02DE30
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

You will not see this message, all you will see is ...

    Det h

------=_NextPart_000_001D_01CFED44.CD02DE30
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 11.00.9600.17344"></HEAD>
<BODY id=3DMailContainerBody=20
style=3D"PADDING-TOP: 15px; PADDING-LEFT: 10px; PADDING-RIGHT: 10px" =
leftMargin=3D0=20
topMargin=3D0 CanvasTabStop=3D"true" name=3D"Compose message area">
<DIV><FONT face=3DCalibri>Om namaha Shivaya</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT>&nbsp;</DIV>
<DIV><FONT face=3DCalibri>Annelen G.</FONT></DIV></BODY></HTML>

------=_NextPart_000_001D_01CFED44.CD02DE30--


The Swedish text directly after the headers may be causing Mailparse to drop the rest of the body ... all you get is "Det h".


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC