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

CommentFileSizeAuthor
#5 mail_sender_name_2679479_5.patch860 bytespetr illek

Comments

Petr Illek created an issue. See original summary.

petr illek’s picture

Issue summary: View changes
petr illek’s picture

Anyone have same problem?

asrob’s picture

Version: 8.0.3 » 8.1.x-dev

Yes, I can confirm this, I've a test site where its name contains "é" and "á".

petr illek’s picture

Version: 8.1.x-dev » 8.2.x-dev
Component: contact.module » mail system
Assigned: Unassigned » petr illek
Status: Active » Needs work
Issue tags: +Drupalaton
StatusFileSize
new860 bytes

Its 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);.

petr illek’s picture

Its 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.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

liam morland’s picture

This looks like a duplicate of #2717965: Site name is not UTF-8 encoded in email headers. Please try the latest patch in that issue.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

jungle’s picture

Status: Needs work » Closed (works as designed)
Issue tags: +Bug Smash Initiative

Looks 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.