MailHost, TypeError on nested MultiPart messages

Bug #642728 reported by Maik Derstappen on 2010-09-19
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released

Bug Description

The following part breaks, if we have an nested MultiPart Message like:

Content-Type: multipart/alternative; boundary="===============0490954888=="
MIME-Version: 1.0
Date: Sun, 27 Aug 2006 17:00:00 +0200
Subject: My multipart email
To: Foo Bar <email address hidden>
From: <email address hidden>

Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

This is plain text.

Content-Type: multipart/related; boundary="===============2078950065=="
MIME-Version: 1.0

Content-Type: text/html; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

<p>This is html.</p>

- for index, payload in enumerate(mo.get_payload()):
- if not isinstance(payload, Message):
- payload = message_from_string(payload)
- charset_match =['Content-Type'] or '')
- if payload.get_filename() is None:
- # No binary file
- if charset and not charset_match:
- payload.set_charset(charset)
- elif charset_match and not charset:
- charset = charset_match.groups()[0]
- mo.get_payload()[index] = payload

here is the test file witch test the nested mutipart message.

please remove the pprint import in the path file ;)

Philip Bauer (pbauer) on 2010-09-24
Changed in zope2:
status: New → Confirmed
Changed in zope2:
milestone: none → 2.10.12
status: Confirmed → Fix Committed
Changed in zope2:
milestone: 2.10.12 → 2.12.12
Changed in zope2:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers