[Email-SIG] other possible issue with the feedparser (email.message_from_*)
xavier delannoy
xavier.delannoy at cloudmark.com
Fri Aug 12 13:33:24 CEST 2011
Hi,
Before opening a bug report at bugs.python.org, I wish to have your
feedback on this:
When a "\r\n" is missing between the headers and the body, the
feedparser silently fix the issue. The ouput buffer is modified (the
\r\n is added, and nothing is appended to the defects list.
In my opinion, as the output buffer is modified, this is a bug.
In the attachment you'll find files.tgz which contains :
- orig.eml : original email
- after.eml: output of email.message_from_string
- test.py: short test script
original email:
{{{
Received: from 127.0.0.1 ([192.168.254.1]) by IMP with bizsmtp
id 4Z3J1h00102awG001Z3J01; Wed, 06 Jul 2011 11:03:18 +0200
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00800000
Message-ID: <4E0AC5F4.1030502 at sample.com>
Date: Wed, 29 Jun 2011 14:28:04 +0800
From: test <from at sample.com>
To: to at sample.com
Subject: a test subject
Here's a wrong email body... \r\n are missing
}}}
email parsed by the feedparser:
{{{
Received: from 127.0.0.1 ([192.168.254.1]) by IMP with bizsmtp
id 4Z3J1h00102awG001Z3J01; Wed, 06 Jul 2011 11:03:18 +0200
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00800000
Message-ID: <4E0AC5F4.1030502 at sample.com>
Date: Wed, 29 Jun 2011 14:28:04 +0800
From: test <from at sample.com>
To: to at sample.com
Subject: a test subject
Here's a wrong email body... \r\n are missing
}}}
Xavier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: files.tgz
Type: application/x-compressed-tar
Size: 686 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/email-sig/attachments/20110812/55a7d8a6/attachment.bin>
More information about the Email-SIG
mailing list