#1 crash on ill-formed message

closed
None
3
2002-09-10
2002-09-10
Auke Jilderda
No

An ill-formed (spam) message crashed the Bounder. The
message was a multipart/alternative with text/plain and
text/html parts. The third boundary was missing. As a
result, the bounder crashed, leaving this trace in my
procmail log:

Traceback (most recent call last):
File "/home/jilderda/bin/bounder", line 193, in ?
main()
File "/home/jilderda/bin/bounder", line 176, in main
msg = email.message_from_file(ifile)
File "/usr/lib/python2.2/email/__init__.py", line 35, in message_from_file
return _Parser(_class).parse(fp)
File "/usr/lib/python2.2/email/Parser.py", line 41, in parse
self._parsebody(root, fp)
File "/usr/lib/python2.2/email/Parser.py", line 117, in _parsebody
raise Errors.BoundaryError(
email.Errors.BoundaryError: Couldn't find terminating boundary: ----=OMAIL_ATT_0.050052738282829

I am running bounder version 1.3.

Discussion

  • Auke Jilderda
    Auke Jilderda
    2002-09-10

    • assigned_to: nobody --> mtherning
     
  • Auke Jilderda
    Auke Jilderda
    2002-09-10

    Logged In: YES
    user_id=97307

    Mmm, it also crashes the bunny, probably on exactly the same
    code (parsing the message and finding out it is ill-formed). We
    should make them more robust, I guess. Traceback of the bunny:

    Traceback (most recent call last):
    File "/home/jilderda/bin/bunny", line 348, in ?
    main()
    File "/home/jilderda/bin/bunny", line 275, in main
    msg = email.message_from_file(sys.stdin)
    File "/usr/lib/python2.2/email/__init__.py", line 35, in message_from_file
    return _Parser(_class).parse(fp)
    File "/usr/lib/python2.2/email/Parser.py", line 41, in parse
    self._parsebody(root, fp)
    File "/usr/lib/python2.2/email/Parser.py", line 117, in _parsebody
    raise Errors.BoundaryError(
    email.Errors.BoundaryError: Couldn't find terminating boundary: ----=OMAIL_ATT_0.0500527382828295

     
    • status: open --> closed
     
  • Logged In: YES
    user_id=588690

    A simple

    try:
    except email.Errors.MessageError:

    around the parsing ought to work. I added it, still pending
    some testing ;-)