summaryrefslogtreecommitdiff
path: root/Lib/rfc822.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1995-06-13 11:19:48 +0000
committerJack Jansen <jack.jansen@cwi.nl>1995-06-13 11:19:48 +0000
commita48426013dc331824abe5510e844a3df1b21c37f (patch)
tree77c70d455f13ffcc5a4ed3f6b6eaeea2e44afa07 /Lib/rfc822.py
parent433c08cbf0622a6b1c0d076dbc00d3c0b487f010 (diff)
downloadcpython-a48426013dc331824abe5510e844a3df1b21c37f.tar.gz
Skip old-style 'From name time' lines at beginning of message.
Diffstat (limited to 'Lib/rfc822.py')
-rw-r--r--Lib/rfc822.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index fcf31fbb97..db5e0d442c 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':