#26227: Unicode attachment filename
-------------------------------------+-------------------------------------
     Reporter:  TheDeadOne           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  email attachment,    |             Triage Stage:
  filenames, i18n                    |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by MoritzS):

 * status:  new => closed
 * needs_better_patch:   => 0
 * resolution:   => invalid
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Originally, being able to have unicode in attachment file names was added
 in ticket #14964.

 I tested this:

 {{{
 from django.core.mail import EmailMultiAlternatives
 msg = EmailMultiAlternatives('Test', 'email body\nend',
 '[email protected]', ['[email protected]'])
 msg.attach_alternative('<html><body>email body<br>end</body></html>',
 'text/html')
 msg.attach(u'fíle_with_ünicöde_çhårs', b'foobar', 'application/octet-
 stream')
 msg.send()
 }}}

 and got following email body:

 {{{
 Content-Type: multipart/mixed;
 boundary="===============5134186686965449755=="
 MIME-Version: 1.0
 Subject: Test
 From: [email protected]
 To: [email protected]
 Date: Wed, 17 Feb 2016 07:17:41 -0000
 Message-ID: <some_number@myhost>

 --===============5134186686965449755==
 Content-Type: multipart/alternative;
  boundary="===============0773237926637752706=="
 MIME-Version: 1.0

 --===============0773237926637752706==
 MIME-Version: 1.0
 Content-Type: text/plain; charset="utf-8"
 Content-Transfer-Encoding: 7bit

 email body
 end
 --===============0773237926637752706==
 MIME-Version: 1.0
 Content-Type: text/html; charset="utf-8"
 Content-Transfer-Encoding: 7bit

 <html><body>email body<br>end</body></html>
 --===============0773237926637752706==--

 --===============5134186686965449755==
 Content-Type: application/octet-stream
 MIME-Version: 1.0
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment;
  filename*="utf-8''f%C3%ADle_with_%C3%BCnic%C3%B6de_%C3%A7h%C3%A5rs"

 Zm9vYmFy
 --===============5134186686965449755==--
 }}}

 According to [https://tools.ietf.org/html/rfc2231 RFC 2231] that is
 encoded correctly. My MUA also displays it correctly, so it seems to be an
 error with Google and Zimbra.

--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.f6b1dff34e32f313d0caef493b01da4e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to