other possible issue with the feedparser (email.message_from_*)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

other possible issue with the feedparser (email.message_from_*)

xavier delannoy
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: <[hidden email]>
Date: Wed, 29 Jun 2011 14:28:04 +0800
From: test <[hidden email]>
To: [hidden email]
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: <[hidden email]>
Date: Wed, 29 Jun 2011 14:28:04 +0800
From: test <[hidden email]>
To: [hidden email]
Subject: a test subject

Here's a wrong email body... \r\n are missing
}}}

Xavier

_______________________________________________
Email-SIG mailing list
[hidden email]
Your options: http://mail.python.org/mailman/options/email-sig/lists%40nabble.com

files.tgz (940 bytes) Download Attachment
Loading...