Empty body parsing in multipart mail with wrong Content-Type #412

Closed
zenzei opened this Issue Jun 27, 2012 · 0 comments

Projects

None yet

2 participants

@zenzei
zenzei commented Jun 27, 2012

I'm parsing the following email with 2.4.4 version and I'm getting an empty body.

This is the email content

Return-Path: <mate@test.name>
X-Original-To: mate@test.name
Delivered-To: mate@test.name.com
Received: from [192.168.1.3] (c-76-109-109-128.hsd1.fl.comcast.net [76.109.109.128])
    (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits))
    (No client certificate requested)
    (Authenticated sender: mail@dan.tobias.name)
    by homiemail-a83.g.dreamhost.com (Postfix) with ESMTPSA id 311725E060
    for <mate@test.name>; Sat, 11 Feb 2012 09:20:15 -0800 (PST)
Resent-from: "Mate" <mate@test.name>
Resent-to: mate@test.name
Resent-date: Sat, 11 Feb 2012 12:19:57 -0500
Received: by gollum (mbox mate)
 (with Cubic Circle's cucipop (v1.31 1998/05/13) Wed Jan  9 17:18:16 2002)
X-From_: gift@Email.com  Wed Jan  9 13:46:39 2002
Received: from BOX_98 (IDENT:root@[206.161.5.198])
        by dot.dreamhost.com (8.12.0.Beta7/8.12.0.Beta7/Debian 8.12.0.Beta7-1) with Message-Id: <200201a2145.g09LjAE16822@BOX_98>
From: "Gift" <gift@Email.com>
To: <mate@test.name>
Date: Wed, 09 Jan 2002 21:46:31 GMT
X-MSMail-Priority: Normal
X-mailer: AspMail 4.0 4.03 (SMT4799A4F)
Subject: Your Gift     (5613AAs18)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="----jkhkjgyurlkmn789809";; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Resent-Message-Id: <248293@homiemail-a83.g.dreamhost.comhomiemail-a83.g.dreamhost.com>

------jkhkjgyurlkmn789809
Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable;


Dear Mate:

Thank you for your test.

------jkhkjgyurlkmn789809
Content-Type: text/html;
Content-Transfer-Encoding: quoted-printable;


<html><body><p>Dear Mate:</p>
<p>Thank you for your test</p>
</body>

</html>


------jkhkjgyurlkmn789809--

As I see, the problem is in the double semi colon on the boundary definition

Content-Type: multipart/alternative; boundary="----jkhkjgyurlkmn789809";; charset="us-ascii"

Because the boundary is recognized as

"----jkhkjgyurlkmn789809";

instead of the correct

"----jkhkjgyurlkmn789809"

If I remove one of the semi-colons, the email is parsed correctly. Is there any recommended way to fix this? A small hack like removing double semicolon in the content-type would be sufficient?

Thanks!

@jeremy jeremy closed this in 64f3e43 Jan 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment