[Python-bugs-list] [ python-Bugs-815563 ] bug with ill-formed rfc822 attachments

SourceForge.net noreply at sourceforge.net
Tue Sep 30 22:32:02 EDT 2003


Bugs item #815563, was opened at 2003-09-30 22:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=815563&group_id=5470

Category: Python Library
Group: Python 2.2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Stuart D. Gathman (customdesigned)
Assigned to: Nobody/Anonymous (nobody)
Summary: bug with ill-formed rfc822 attachments

Initial Comment:
The following proglet gets an except with the attached

message:

-----te.py--------

import email

import sys



msg = email.message_from_file(sys.stdin)

sys.stdout.write(msg.as_string())

------------------

python2 te.py <failingmsg

Traceback (most recent call last):

  File "te.py", line 4, in ?

    msg = email.message_from_file(sys.stdin)

  File "/usr/lib/python2.2/email/__init__.py", line 63,

in message_from_file

    return Parser(_class, strict=strict).parse(fp)

  File "/usr/lib/python2.2/email/Parser.py", line 64,

in parse

    self._parsebody(root, fp, firstbodyline)

  File "/usr/lib/python2.2/email/Parser.py", line 239,

in _parsebody

    msgobj = self.parsestr(part)

  File "/usr/lib/python2.2/email/Parser.py", line 75,

in parsestr

    return self.parse(StringIO(text),

headersonly=headersonly)

  File "/usr/lib/python2.2/email/Parser.py", line 64,

in parse

    self._parsebody(root, fp, firstbodyline)

  File "/usr/lib/python2.2/email/Parser.py", line 264,

in _parsebody

    msg = self.parse(fp)

  File "/usr/lib/python2.2/email/Parser.py", line 64,

in parse

    self._parsebody(root, fp, firstbodyline)

  File "/usr/lib/python2.2/email/Parser.py", line 205,

in _parsebody

    raise Errors.BoundaryError(

email.Errors.BoundaryError: No terminating boundary and

no trailing empty line

-------------------

The message/rfc822 attachment really is missing the

boundary.  However, that is why it is being returned as

an attachment in the first place!  Is it illegal for

message/rfc822 attachments to have invalid MIME

construction?



I suggest that a message attachment that fails MIME

boundary decoding, should become a plain rfc822 object,

or perhaps a text object.  I don't know.  



Anyway, I get tons of messages with this property that

have to be processed by my Python milter.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=815563&group_id=5470



More information about the Python-bugs-list mailing list