MailHost, TypeError on nested MultiPart messages

Bug #642728 reported by Maik Derstappen
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Zope 2
Fix Released
Undecided
Unassigned

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>

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

This is plain text.

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

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

<p>This is html.</p>
--===============2078950065==--
--===============0490954888==--

- for index, payload in enumerate(mo.get_payload()):
- if not isinstance(payload, Message):
- payload = message_from_string(payload)
- charset_match = CHARSET_RE.search(payload['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

Tags: mailhost
Revision history for this message
Maik Derstappen (maik-derstappen) wrote :
Revision history for this message
Maik Derstappen (maik-derstappen) wrote :

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

Revision history for this message
Maik Derstappen (maik-derstappen) wrote :

please remove the pprint import in the path file ;)

Philip Bauer (pbauer)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.