Opened 3 years ago
Closed 3 years ago
#33660 closed Bug (needsinfo)
EmailMessage encode the subject in base64 when translated and contains non US-ASCII characters
Reported by: | Yann | Owned by: | nobody |
---|---|---|---|
Component: | Core (Mail) | Version: | 4.0 |
Severity: | Normal | Keywords: | EmailMessage Translation base64 quoted-printable |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The usual behavior of the EmailMessage class regarding its subject is to keep it as it is if i contains only US-ASCII characters and to encode it as quoted-printable if it contains non US-ASCII characters.
That works well and avoid our emails to be considered as pishing by antispam from email servers
But in the specific context of translations there is a bug -> if the subject of an email is translated into another language (through the built-in django translations tools) and contains non US-ASCII characters, by an mechanism I didn't catch, the subject is encoded as base64 and not quoted-printable.
This results in being considered as spam by the email servers (tested on Gandi and Gmail)...
Thanks for the report. However I cannot reproduce this issue with the following test:
tests/mail/tests.py
Can you provide a sample project or a test case?