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: mailbox.PortableUnixMailbox fails to parse 'From ' in body
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: akuchling, hdiwan650, larsks
Priority: normal Keywords:

Created on 2006-04-14 03:35 by larsks, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg28222 - (view) Author: Lars Kellogg-Stedman (larsks) Date: 2006-04-14 03:35
I have a Unix mailbox file that contains the following
text in the body of a message:

---[ cut here ]---
EFCO also offers casements with integral blinds. See:=20
http://www.efcocorp.com/public/earm/products/default.asp?j=3D1&P=3D43&L=3D=
1=20
From that page, select select "Features and Benefits"
from under the
heading "Product Overview"=20
---[ cut here ]---

mailbox.PortableUnixMailbox erroneously interprets the
"From" at the beginning of the line as the beginning of
a new message.  Since 'From ' is only a valid header at
the  beginning of a message, perhaps the module could
look at the following line and see if it looks like an
RFC2822 header before accepting 'From ' as a message
delimiter.
msg28223 - (view) Author: Hasan Diwan (hdiwan650) Date: 2006-04-14 08:30
Logged In: YES 
user_id=1185570

Use rfc822.py in lieu of mailbox to first parse the message
into an rfc822.Message... then pass it to the
Mailbox.PortableUnixMailbox constructor. 
msg28224 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-08-02 12:28
Logged In: YES 
user_id=11375

See the comment in mailbox.py in the UnixMailbox class, too.
 UnixMailbox uses a stricter regex to look for from lines,
but this proves too strict in practice so
PortableUnixMailbox is much less strict.  mbox format isn't
very good, and we're just stuck with this behaviour.

Closing this bug as "won't fix".
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43200
2006-04-14 03:35:32larskscreate