[issue11021] email MIME-Version headers for each part in multipart message

David Caro report at bugs.python.org
Thu Jan 27 00:47:25 CET 2011


New submission from David Caro <david.caro.estevez at gmail.com>:

When attaching a subpart to a multipart message, python should follow the recomendations of the rfcs and remove the MIME-Version header of each part, leaving only one MIME-Version header at the beggining of the message.


>>> from email.mime.multipart import MIMEMultipart
>>> from email.mime.text import MIMEText
>>> usermail=MIMEMultipart('alternative')
>>> part=MIMEText('text')
>>> print part
>From nobody Thu Jan 27 00:33:50 2011
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

text
>>> usermail.attach(part)
>>> print usermail
>From nobody Thu Jan 27 00:45:26 2011
Content-Type: multipart/alternative; boundary="===============1006894803=="
MIME-Version: 1.0

--===============1006894803==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

text
--===============1006894803==--

----------
components: Library (Lib)
messages: 127161
nosy: david.caro
priority: normal
severity: normal
status: open
title: email MIME-Version headers for each part in multipart message
type: behavior
versions: Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11021>
_______________________________________


More information about the Python-bugs-list mailing list