[Django] #26227: Unicode attachment filename

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

[Django] #26227: Unicode attachment filename

Django
#26227: Unicode attachment filename
---------------------------+-----------------------------------------------
     Reporter:             |      Owner:  nobody
  TheDeadOne               |
         Type:  Bug        |     Status:  new
    Component:  Core       |    Version:  1.9
  (Mail)                   |
     Severity:  Normal     |   Keywords:  email attachment, filenames, i18n
 Triage Stage:             |  Has patch:  0
  Unreviewed               |
Easy pickings:  0          |      UI/UX:  0
---------------------------+-----------------------------------------------
 When attaching a file with name containing non ASCII symbols, GMail
 display this attachment as "noname" and Zimbra 8.0.2 as percent-encoded.

 {{{
 from django.template.loader import get_template
 from django.core.mail import send_mail, EmailMultiAlternatives
 txt_msg_body = get_template('email.txt').render({})
 html_msg_body = get_template('email.html').render({})
 msg = EmailMultiAlternatives('Test', txt_msg_body, '[hidden email]',
 ['[hidden email]'])
 msg.attach_alternative(html_msg_body, "text/html")
 with open('test.pdf', 'rb') as fh:
     data = fh.read()
 msg.attach(u'Имя файла', data, 'application/pdf')
 msg.send()
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26227>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/053.f120bf766f452a06d0d3ae3da2ad8327%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename

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

 * Attachment "GMailAndZimbra.png" added.

 Emails screenshot

--
Ticket URL: <https://code.djangoproject.com/ticket/26227>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.7fd4649f9312b371fc857758e061d416%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename

Django
In reply to this post by Django
#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',
 '[hidden email]', ['[hidden email]'])
 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: [hidden email]
 To: [hidden email]
 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 [hidden email].
To post to this group, send email to [hidden email].
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 | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename

Django
In reply to this post by Django
#26227: Unicode attachment filename
-------------------------------------+-------------------------------------
     Reporter:  TheDeadOne           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     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 gasinvein):

 * status:  closed => new
 * resolution:  invalid =>


Comment:

 Is this filename encoding really correct? I have same problem, and none of
 tried MUAs (including Gmail, Outlook and Kmail) doesn't show filenames
 correctly.

 Replying to [comment:1 MoritzS]:
 > 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',
 '[hidden email]', ['[hidden email]'])
 > 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: [hidden email]
 > To: [hidden email]
 > 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:2>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.7e49235372646d8148f7d60ba1f5f8b3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename

Django
In reply to this post by Django
#26227: Unicode attachment filename
-------------------------------------+-------------------------------------
     Reporter:  TheDeadOne           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     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 gasinvein):

 * Attachment "Screenshot_20160915_125209.png" added.

 Django unicode filenames in Kmail

--
Ticket URL: <https://code.djangoproject.com/ticket/26227>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.594b2ae1c1d4e182924172bc323d2541%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename

Django
In reply to this post by Django
#26227: Unicode attachment filename
-------------------------------------+-------------------------------------
     Reporter:  TheDeadOne           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     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
-------------------------------------+-------------------------------------

Comment (by claudep):

 Just tested now on Thunderbird (Linux), Gmail and Roundcube, and the
 filename is displaying fine.

--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:3>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.7bd365282c08ddaab420db9d0f14fd98%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename displays incorrectly in some clients (was: Unicode attachment filename)

Django
In reply to this post by Django
#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
     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 timgraham):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 @gasinvein, please tell us where the bug is in Django if it's an issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:4>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.8c07a50d55168eaa675917bd0ce314cb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename displays incorrectly in some clients

Django
In reply to this post by Django
#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
     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
-------------------------------------+-------------------------------------

Comment (by gasinvein):

 > Just tested now on Thunderbird (Linux), Gmail and Roundcube, and the
 filename is displaying fine.
 So what am I doing wrong? Tried your eample in comment:1.

--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:5>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.f7881cf37dfd8c8fb6742d6cf13fe7e1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename displays incorrectly in some clients

Django
In reply to this post by Django
#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
     Reporter:  Sergey Gornostaev    |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     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 Thomi Richards):

 * status:  closed => new
 * resolution:  invalid =>


Comment:

 Hi,

 I came across this issue in django 1.11.11 - using the `EmailMessage`
 class, attachments with non-ascii characters in their filenames render as
 'noname' in GMail.

 I'm no expert in MIME - I've read RFC2231 and RFC2047, which seem to be
 on-topic for this case. However, the exact "correct" behaviour here isn't
 obvious to me. However, I was able to fix the issue like so:

 {{{
 class EmailMessageWithAttachmentEncoding(EmailMessage):
     def _create_attachment(self, filename, content, mimetype=None):
         attachment = self._create_mime_attachment(content, mimetype)
         if filename:
             try:
                 parameters = {
                     'filename': filename.encode('ascii'),
                 }
             except UnicodeEncodeError:
                 # Include both parameters manually because Python's
 implementation
                 # only adheres to RFC2231 and not RFC2047 which breaks
 some clients
                 # such as GMail.
                 filename = Header(filename, 'utf-8').encode()
                 parameters = {
                     'filename*': filename,  # RFC2231
                     'filename': filename,  # RFC2047
                 }
             attachment.add_header('Content-Disposition', 'attachment',
 **parameters)
         return attachment
 }}}

 I'm not sure if the django project would accept this as a patch,
 especially since it seems to me like the correct behaviour here is
 somewhat undefined (perhaps there's a MIME expert willing to testify?). In
 any case, this solution has worked for me, and might help others who
 stumble across this page while trying to debug the same issue.

 I've re-opened the issue, since it seems like we probably want django's
 email features to work with GMail, even if the fix differs from what I've
 pasted above.

--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:6>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.412b7e96d78a56a4bd4220dccca2e812%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename displays incorrectly in some clients

Django
In reply to this post by Django
#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
     Reporter:  Sergey Gornostaev    |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     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 Thomi Richards):

 * cc: Thomi Richards (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:7>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.ee24c047d96246bca2d69d0127687eab%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename displays incorrectly in some clients

Django
In reply to this post by Django
#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
     Reporter:  Sergey Gornostaev    |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:  needsinfo
     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 Tim Graham):

 * status:  new => closed
 * resolution:   => needsinfo


Comment:

 What are the steps to reproduce the issue? I tried the steps in the ticket
 description and the attachment name looks fine. Also, please test with
 Django master (or at least Django 2.1 beta)  rather than Django 1.11 which
 is quite old at this point.

--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:8>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.ed91f89de4ec090b988a6e61c64b2f00%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename displays incorrectly in some clients

Django
In reply to this post by Django
#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
     Reporter:  Sergey Gornostaev    |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     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 Simon Charette):

 * status:  closed => new
 * resolution:  needsinfo =>


Comment:

 I managed to reproduce by sending an email to a @gmail.com address with an
 attachment containing non-ASCII characters on master.

 {{{#!python
 msg = EmailMultiAlternatives('Subject', 'Body', '...@gmail.com', [
 '...@gmail.com'])
 msg.attach(u'Имя файла', BytesIO(b'hello word'), 'text/plain')
 msg.send()
 }}}

 The issue seems to be that GMail ignores RFC2231 header parameters (e.g.
 `filename*=`) and only accepts RFC2047 ones (`filename=?UTF...`).

 The code changes suggested by Thomi include both parameters if the
 attachment name is not ASCII encodable.

--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:9>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.c3e50c6a56c432d71baaae6defad8eb2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename displays incorrectly in some clients

Django
In reply to this post by Django
#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
     Reporter:  Sergey Gornostaev    |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     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
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

 The name appears fine on the web version of gmail I'm using. I'll attach a
 screenshot with what I see.

--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:10>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.e8ea8ca0e8d0512845e7d137e11265d8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename displays incorrectly in some clients

Django
In reply to this post by Django
#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
     Reporter:  Sergey Gornostaev    |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Core (Mail)          |                  Version:  1.9
     Severity:  Normal               |               Resolution:
     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 Tim Graham):

 * Attachment "gmail-screenshot.png" added.


--
Ticket URL: <https://code.djangoproject.com/ticket/26227>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.28e30cb8d1059d24f20f2a7df80b087d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: [Django] #26227: Unicode attachment filename displays incorrectly in some clients

Django
In reply to this post by Django
#26227: Unicode attachment filename displays incorrectly in some clients
-------------------------------------+-------------------------------------
     Reporter:  Sergey Gornostaev    |                    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 Simon Charette):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 It looks like I can't reproduce against master anymore as the issue
 manifests itself on Python 2, sorry for the false alarm Tim.

 Here's how the attachment is sent on Python 2

 {{{
 MIME-Version: 1.0
 Content-Type: text/plain; charset="utf-8"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename*="utf-8''%D0%98%D0%BC%D1%8F%20%D1%84%D0%B0%D0%B9%D0%BB%D0%B0"

 data
 }}}

 And on Python 3

 {{{
 Content-Type: text/plain; charset="utf-8"
 MIME-Version: 1.0
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename*=utf-8''%D0%98%D0%BC%D1%8F%20%D1%84%D0%B0%D0%B9%D0%BB%D0%B0

 data
 }}}

 Notice that both use a RFC 2231 `filename*=` parameter but the value is
 within double quotes on Python 2 while it isn't on Python 3. That seems to
 be the reason why GMail rejects the encoded value.

 This was changed in Python 3.1
 [https://github.com/python/cpython/commit/dfd7eb0ba2f3296f28028970e395e38f3ae9eedc
 dfd7eb] and detailed in [https://bugs.python.org/issue1693546
 CPython#1693546]

--
Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:11>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.38c1370bfa33fb4994fee182a4943c1c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.