Fixed #18967 -- Don't base64-encode message/rfc822 attachments.

Thanks Michael Farrell for the report and his work on the fix.
This commit is contained in:
Ramiro Morales 2013-08-20 22:17:26 -03:00 committed by Andrew Godwin
parent 839940f27f
commit 01223840f3
3 changed files with 86 additions and 5 deletions

View file

@ -319,6 +319,18 @@ The class has the following methods:
message.attach('design.png', img_data, 'image/png')
.. versionchanged:: 1.7
If you specify a ``mimetype`` of ``message/rfc822``, it will also accept
:class:`django.core.mail.EmailMessage` and :py:class:`email.message.Message`.
In addition, ``message/rfc822`` attachments will no longer be
base64-encoded in violation of :rfc:`2046#section-5.2.1`, which can cause
issues with displaying the attachments in `Evolution`__ and `Thunderbird`__.
__ https://bugzilla.gnome.org/show_bug.cgi?id=651197
__ https://bugzilla.mozilla.org/show_bug.cgi?id=333880
* ``attach_file()`` creates a new attachment using a file from your
filesystem. Call it with the path of the file to attach and, optionally,
the MIME type to use for the attachment. If the MIME type is omitted, it
@ -326,8 +338,6 @@ The class has the following methods:
message.attach_file('/images/weather_map.png')
.. _DEFAULT_FROM_EMAIL: ../settings/#default-from-email
Sending alternative content types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~