The email package and KLEZ mails

Gerson Kurz moc.q-dnan-p at p-nand-q.com
Tue May 28 04:21:56 EDT 2002


I'm using the email module (new in Python 2.2) to analyze messages for
spam and HTML content. However, I get exceptions when analyzing KLEZ
generated mails, which is disappointing since I'm trying to filter
them in the first place. 

Anyway, the callstack boils down to:

  File "C:\Python22\lib\email\Parser.py", line 81, in _parseheaders
    raise Errors.HeaderParseError( 'Not a header, not a continuation:
"%s"' % line)
HeaderParseError: Not a header, not a continuation:
"--X675I6X36yZg9J7wg290j"

Note that I manually added the "%s" bit to the source of Parser.py, to
see what exactly causes the error, the rest of the file is unchanged.
Now, when I look at the email headers, they look something like this:

<QUOTE>
Received: from mcrt-kl-my-1.inter-touch.net (203.121.124.130) by
Shicks! Version 0.9 on darkstar at Tue May 28 08:56:17 2002
Received: from Nrdqtbuem ([203.121.124.154])
	by mcrt-kl-my-1.inter-touch.net (8.9.3/8.9.3) with SMTP id
PAA29881
	for <...(some address here)...>; Tue, 28 May 2002 15:56:49
+0800
Date: Tue, 28 May 2002 15:56:49 +0800
Message-Id: <...(some msgid here)...>
From: jraj_5 <...(some address here)...>
To: ...(some address here)...
Subject: A  good tool
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary=X675I6X36yZg9J7wg290j

--X675I6X36yZg9J7wg290j
Content-Type: text/html;
... (Rest of mail stripped)...
</QUOTE>

and the email package seems to be missing the correct boundary syntax.






More information about the Python-list mailing list