]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Skip old-style 'From name time' lines at beginning of message.
authorJack Jansen <jack.jansen@cwi.nl>
Tue, 13 Jun 1995 11:19:48 +0000 (11:19 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Tue, 13 Jun 1995 11:19:48 +0000 (11:19 +0000)
Lib/rfc822.py

index fcf31fbb9706e598df2b886c5c1de9eec03dcb01..db5e0d442c118f2708282b17e7a5705761c1356d 100644 (file)
@@ -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':