Comment 1 for bug 266310

Revision history for this message
Mark Sapiro (msapiro) wrote :

The underlying cause of this problem is the fact that the
original message contains a subpart of type
message/delivery-status which in turn contains a text/plain
'returned message'. The reason this is a problem is that the
Python email library parses message/delivery-status parts
differently from other MIME parts. It considers groups of
lines separated from each other by empty lines to each be
the headers of a sub-part of the message/delivery-status
part, and these sub-parts all have only headers and no bodies.

One of these sub-parts in this case has headers with
content-type text/plain which causes scrubber to try to
include the decoded body of this part in the flattened
text/plain message which causes the error.

The attached patch will catch the exception in this case and
allow the message to be added to the archive, but the entire
message/delivery-status part will not be in the archived
message because the parser treats it as all headers and no body.

Please try the patch and report whether you think this is
satisfactory.