Hi,
in love with D8 so far. :)
But today I run into a problem.
I've a site with site name: Bělidlo. (notice the "ě")
If I send a mail using core contact form I receive email from "Bělidlo @domain.com" instead of from "Bělidlo" (where domain.com is email server). Thus it is not acceptable for my clients…
If I rename the site to: Belidlo (removed the special character "ě") its working OK. (But thats not acceptable either. :)
I've tested it on normal hosting and then for reference on Acquia, both have the same result.
In the source code of the receive message there is this different part.
Send from Bělidlo:
From: =?UTF-8?B?Qnl0eSBOYSBCxJtsaWRsZSA8aW5mb0BjZXNrYXJlYWxpdG5pc3JvLmN6Pg==?=@domain.com
Send from Belidlo:
From: Belidlo <info@belidlo.xx>
If you need more information I will try to provide them.
Petr
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | mail_sender_name_2679479_5.patch | 860 bytes | petr illek |
Comments
Comment #2
petr illekComment #3
petr illekAnyone have same problem?
Comment #4
asrobYes, I can confirm this, I've a test site where its name contains "é" and "á".
Comment #5
petr illekIts appears, that if there is no '@' sign in the From attribute, the mail server adds its own '@mailserverdomain.xx' to it. And in case the From attribute get encoded in UTF8, there is not '@'. But later in the mail client UTF is decoded again and we get wrong From attribute.
I've created an initial patch against latest dev of Drupal 8.2.
My approach is to force the encoding of both the Site name and Email address (as domains can have UTF letters too).
I only need to leave the '@' sign in, so I'm exploding the Email address and encode it by parts.
ToDo: Need to figure out how to create a Test
I was thinking about the correct test scenario and thanks to Radim Klaška we think that we should test if the string is encoded or doesn't have any UTF8 letters. This might be done by this function base64_decode('[string]', true);.
Comment #6
petr illekIts definitely needs more work. Especially the explode part was done with a wrong assumption, that there can be just one '@' sign in the email address, but according to spec, there can be more than one presented (http://stackoverflow.com/questions/3844431). I think I will try to explode the address on the last '@' sign in the string.
Comment #8
liam morlandThis looks like a duplicate of #2717965: Site name is not UTF-8 encoded in email headers. Please try the latest patch in that issue.
Comment #14
jungleLooks like #2717965: Site name is not UTF-8 encoded in email headers fixed it, I am going to close this, please reopen it when necessary.