#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 -------------------------------------+-------------------------------------
Comment (by milosu): To be honest, I'm still having the "noname" problem in GMail, when some utf-8 characters are present in the filename. I can see that the e-mail I'm sending does not have the double quotes around filename. But my application is behind two Microsoft SMTP Servers (internal and outbound) and it looks like one of them will silently add the double quotes before sending the message to Google Gmail. That being said, what works for me is really the patch to _create_attachment method as proposed by Thomi in Comment No. 6. With his patch applied, the raw e-mail when received by Google looks like: {{{ --===============0157380707== Content-Type: application/pdf MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="gartner_ěščřšěřšěčéříš909.pdf" --===============0157380707==-- }}} and the filename will be displayed correctly. Without the patch, Google will display no-name filename and the headers look like: {{{ --===============2001112103== Content-Type: application/pdf MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*="utf-8''gartner_%C4%9B%C5%A1%C4%8D%C5%99%C5%A1%C4%9B%C5%99%C5%A1%C4%9B%C4%8D%C3%A9%C5%99%C3%AD%C5%A1909.pdf" }}} While the raw e-mail when generated by Django without the patch looks like: {{{ --===============0135089781== Content-Type: application/pdf MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename*=utf-8''gartner_%C4%9B%C5%A1%C4%8D%C5%99%C5%A1%C4%9B%C5%99%C5%A1%C4%9B%C4%8D%C3%A9%C5%99%C3%AD%C5%A1909.pdf }}} So somehow Microsoft SMTP Server or some third-party filter adds the double quotes during processing. The error does not happen when sending the same e-mail via Postfix. Looks like tricky interoperability problem indeed.. Thank you Thomi anyway.. -- Ticket URL: <https://code.djangoproject.com/ticket/26227#comment:12> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.9f053d6ce549090f4ee4e704fed53158%40djangoproject.com.