This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: email.generator.Generator doesn't mangle "From " lines in MIME preamble
Type: behavior Stage: resolved
Components: email, Library (Lib) Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Chris.Pickett, barry, petri.lehtinen, python-dev, r.david.murray
Priority: normal Keywords:

Created on 2012-07-01 05:02 by Chris.Pickett, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
maildir_bug.tar.gz Chris.Pickett, 2012-07-01 05:02
Messages (7)
msg164450 - (view) Author: Chris Pickett (Chris.Pickett) Date: 2012-07-01 05:02
tar xvfz maildir_bug.tar.gz
cd maildir_bug
./bug.sh

The attachment contains a maildir with a single message.  This message has two body lines beginning with 'From '.  When converted to mbox using the maildir2mbox.py, only the second line gets a '>' at the beginning.  Thunderbird subsequently splits the message in two.  I think the fix is to put a '>' in front of each 'From ' line and not just the second one.  However, when I did that, Thunderbird displayed the '>', so either it is not the right fix, or Thunderbird has a bug.

I am using Python 2.7.1.  I searched the bug tracker and didn't see this issue, so decided to file even though I don't have the latest version.

Chris
msg164493 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2012-07-01 18:42
Hi and thanks for the report. It seems that this is a bug in email.generator.Generator, as it fails to mangle "From " lines in the MIME preamble (after the headers, before the first "--Boundary..." line).
msg166195 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-07-23 01:55
New changeset b97f65f2298d by R David Murray in branch '3.2':
#15232: correctly mangle From lines in MIME preamble and epilogue
http://hg.python.org/cpython/rev/b97f65f2298d

New changeset 80b81658455b by R David Murray in branch 'default':
Merge #15232: correctly mangle From lines in MIME preamble and epilogue
http://hg.python.org/cpython/rev/80b81658455b

New changeset 9f500171c592 by R David Murray in branch '2.7':
#15232: correctly mangle From lines in MIME preamble and epilogue
http://hg.python.org/cpython/rev/9f500171c592
msg166196 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-07-23 01:56
Same problem with the epilogue.  Fixed both.
msg166262 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2012-07-24 04:26
Thanks. The news entry should probably say 'From ' instead of 'From'.
msg166319 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-07-24 18:24
New changeset 0caff799e4bf by R David Murray in branch '3.2':
#15232: make NEWS entry more accurate.
http://hg.python.org/cpython/rev/0caff799e4bf

New changeset d53524c43d0e by R David Murray in branch 'default':
#15232: make NEWS entry more accurate.
http://hg.python.org/cpython/rev/d53524c43d0e

New changeset e9ffde2c7da3 by R David Murray in branch '2.7':
#15232: make NEWS entry more accurate.
http://hg.python.org/cpython/rev/e9ffde2c7da3
msg166857 - (view) Author: Chris Pickett (Chris.Pickett) Date: 2012-07-30 05:23
Thanks everyone!
History
Date User Action Args
2022-04-11 14:57:32adminsetgithub: 59437
2012-07-30 05:23:48Chris.Pickettsetmessages: + msg166857
2012-07-24 18:24:57python-devsetmessages: + msg166319
2012-07-24 04:26:35petri.lehtinensetmessages: + msg166262
2012-07-23 01:56:22r.david.murraysetstatus: open -> closed
resolution: fixed
messages: + msg166196

stage: needs patch -> resolved
2012-07-23 01:55:34python-devsetnosy: + python-dev
messages: + msg166195
2012-07-01 18:42:36petri.lehtinensettype: behavior
title: maildir parsing can split up messages with 'From ' at the start of a line -> email.generator.Generator doesn't mangle "From " lines in MIME preamble
components: + Library (Lib)

nosy: + petri.lehtinen
versions: + Python 2.7, Python 3.2, Python 3.3
messages: + msg164493
stage: needs patch
2012-07-01 05:38:34r.david.murraysetnosy: + barry, r.david.murray
components: + email
2012-07-01 05:02:24Chris.Pickettcreate