I have an "é" (it's called création-handicap.ch) in my page title site name. so the from sender gets scrambled from my webform mails. here an extract from the email header:
From: =?utf-8?Q?creation-handicap_via_Cr=C3=A9ation-Handicap?=<webmaster@creation-handicap.ch>
in the attachements you see a screenshot..
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | webform-site-name-containing-UTF-8-2449501-16.patch | 1.08 KB | das.gautam |
| #13 | UTF-8_FROM_field.png | 21.5 KB | akshayadhav |
| #10 | webform-site_name_utf8-2449501-10.patch | 1.88 KB | danchadwick |
| mail-screenshot.jpg | 148.66 KB | maki3000 |
Comments
Comment #1
danchadwick commentedI don't think you mean Page Title. What exactly is création-handicap.ch? Is this is the site name?
Comment #2
maki3000 commentedYes! of course! sry for that. i mean the site name!
the site name is being included in the from sender name, but has no utf-8 support. also the E-mail-from-name field does not accept umlauts and special characters as described in here: https://www.drupal.org/node/2408345
Comment #3
danchadwick commentedMakes sense now. The site name needs to be run through transliteration before being included in an e-mail address for "From".
Comment #4
quicksketchAs with #2408345: Email sender name does not accept non-ascii characters, the encoding is intentional, as headers must be encoded if they contain non-latin characters per the standard for e-mail itself:
http://ncona.com/2011/06/using-utf-8-characters-on-an-e-mail-subject/
http://datatracker.ietf.org/doc/rfc1342/
If Webform is encoding the headers incorrectly, we should fix that. But it may be that your mail client simply doesn't support encoded headers properly, which would be an issue with the mail client. We shouldn't try to transliterate headers as we'd end up mangling people's names that may be written in non-latin characters such as Cyrillic or Chinese.
Comment #5
danchadwick commented@quicksketch -- Thanks. Just to clarify, this is due to the new Reply-To feature and the long webform email address setting, both of which can be disabled.
I started to google for what exactly what can be in the name part of an e-mail address but didn't quickly find a definitive answer. Do you know for sure what characters are allowed in the "name" part of an email in the form:
"Joe Blow via Your Crazy Site"<admin@crazysite.com>It seems pretty clear that at least double quotes and left angle bracket should be removed, which is not the OP's issue.
Comment #6
danchadwick commentedComment #7
danchadwick commentedI just tried this exact name with gmail, and indeed gmail can't decode the FROM or REPLY TO headers.
Sanitized excerpt:
Un-sanitized except:
I also tried forcing the encoding to be caps (UTF-8), but it seems to be converted to lowercase or overwritten elsewhere, so I conclude that that's not the issue.
I'm not sure why my encoding is
so much more "encoded" that the OP's"B" Base64 encoding and the OP is "Q" Quoted Printable encoding, but I don't think it's relevant. Gmail displays nothing for the From address. Definitely a problem.Comment #8
quicksketchI tried just sending an e-mail from Gmail and here's what Gmail itself sends:
The text I included in the header and in the to address and subject was
An ümläut test(which I know isn't the right use of umlauts, but I did it to include unusual UTF-8 characters).Comment #9
danchadwick commentedRight. The "Joe Blow via Your Domain" needs to be encoded, and the actual e-mail address and angle brackets must not be encoded.
#861640: names <email> addresses are not correctly encoded with utf-8 special characters in the mail headers
What I'm struggling with now is when the string is too long, mime_header_encode breaks it into chunks, which then breaks the From header. I'm breaking it into words and encoding each word. The greatly reduces the risk. There is still an overall length of 254 for an e-mail address, and apparently there is truncation of after encoding the whole combined address is too long. I think this will just be tough luck.
Comment #10
danchadwick commentedCommitted to 7.x-4.x and 8.x.
Comment #13
akshayadhavI have installed latest module, but still I'm facing the issue of scrambled FROM sender name, which is nothing but site name.
Comment #14
danchadwick commentedRe #13 -- Looks like you have a support issue. Please open a new issue. You haven't supplied enough information to help you. Please provide:
Your global webform configuration as they relate to e-mail.
Your site's name.
Your site's e-mail address.
Your webform's from name and address specification.
I can't tell from the screenshot you supplied, but it looks like a properly encoded FROM address encoded as a name, but the from e-mail address itself, which should not be encoded, isn't included.
Note that Webform doesn't support non-ASCII e-mail address, such as diacritical marks or ideographic languages. There is an issue to support this in Drupal 8 core.
Comment #15
akshayadhavThanks for the reply. No need for new thread, resolved the issue by adding HTML email template in the theme structure.
Comment #16
das.gautam commentedFaced the same issue in Drupal 8, created a patch for the same.