Possible bug in Email and Multifile Modules ?

Oleg Broytmann phd at phd.pp.ru
Mon Feb 4 04:49:06 EST 2002


Hi!

On Mon, Feb 04, 2002 at 01:01:43AM -0800, Sheila King wrote:
> >>> msg = email.message_from_file(open('virus.txt'))
> Traceback (most recent call last):
>   File "<interactive input>", line 1, in ?
>   File "E:\PYTHON\PYTHON22\lib\email\__init__.py", line 35, in
> message_from_file
>     return _Parser(_class).parse(fp)
>   File "E:\PYTHON\PYTHON22\lib\email\Parser.py", line 40, in parse
>     self._parsebody(root, fp)
>   File "E:\PYTHON\PYTHON22\lib\email\Parser.py", line 116, in _parsebody
>     raise Errors.BoundaryError(
> BoundaryError: Couldn't find terminating boundary:
> ====_ABC1234567890DEF_====
> =============(end interpreter session)================
> 
> Now, it turns out that this message is not well formed. Instead of the
> correct closing boundary at the end of the message, it has a boundary which
> indicates that another part should follow.
> 
> >  No parts were removed, it's 100% intact. And you're right, it's not
> >  well-formed, but that's the whole idea behind it. It tricks Outlook
> >  into executing the attachment.
> > But not being well-formed shouldn't break anything...

   GIF viewer should not display EXE-files. PDF viewer should not print
broken PDFs. And email scanner should not scan files that are not emails.
Just drop it on the flor and forget.
   That M$ Outofluck id dangerously broken, but I don't see a reason to
repeat its bugs and put them into Python libraries.
   If you want to automatically scan emails - scan those that are real
well-formed emails, and put broken files into separate mail folder to deal
with them manually.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.




More information about the Python-list mailing list