summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-13 11:19:48 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1995-06-13 11:19:48 (GMT)
commit3a15dca1a03e72be1d15febd449b4c582273153d (patch)
treea1a90dbc601346e1f7be99781f6c0070adb38921 /Lib
parentfbe6d33ffd64ce1b31b2dab332c617f96b5e3fbf (diff)
downloadcpython-3a15dca1a03e72be1d15febd449b4c582273153d.zip
cpython-3a15dca1a03e72be1d15febd449b4c582273153d.tar.gz
cpython-3a15dca1a03e72be1d15febd449b4c582273153d.tar.bz2
Skip old-style 'From name time' lines at beginning of message.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/rfc822.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index fcf31fb..db5e0d4 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -86,11 +86,17 @@ class Message:
self.headers = list = []
self.status = ''
headerseen = 0
+ firstline = 1
while 1:
line = self.fp.readline()
if not line:
self.status = 'EOF in headers'
break
+ # Skip unix From name time lines
+ if firstline and (line[:5] == 'From '
+ or line[:6] == '>From '):
+ continue
+ firstline = 0
if self.islast(line):
break
elif headerseen and line[0] in ' \t':