From 3a15dca1a03e72be1d15febd449b4c582273153d Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 13 Jun 1995 11:19:48 +0000 Subject: [PATCH] Skip old-style 'From name time' lines at beginning of message. --- Lib/rfc822.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/rfc822.py b/Lib/rfc822.py index fcf31fbb970..db5e0d442c1 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':