Hello !
Used with simplenews.
When a specify a "from name" with accent (éèà) it is passed throught mime_header_encode. But then I always get a displayed "from name" formated with "=?UTF-8?B?Ij0/ ......"
When I dont use accent, it's working as expected.
Disabling the mime_header_encode generate a "no sender detected" by gmail, but thunder read it correctly.
Complete from header is : (seems to be encoded several time .. no ?)
From: =?UTF-8?B?Ij0/VVRGLTg/Qj9RblZ5WldGMUlHUjFJR1REcVd6RHFXZDF3NmtndzZBZ2JHRWc=?=
=?UTF-8?B?UjJWdXc2aDJaU0JwYm5SbGNtNWhkR2x2Ym1FPT89CiA9P1VURi04P0I/YkdVZz8=?=
=?UTF-8?B?PSIgPGluZm8uZ2VuZXZlLmludGVybmF0aW9uYWxlQGV0YXQuZ2UuY2g+?=
Any hints welcome ..
Marc
Comment | File | Size | Author |
---|---|---|---|
#7 | mimemail-1209018-7.patch | 569 bytes | sgabe |
#5 | from_and_sender_encode-1209018.patch | 909 bytes | drikc |
Comments
Comment #1
sgabe CreditAttribution: sgabe commentedSimplenews encodes the name, later Mime Mail also encodes the header values, so they can be encoded twice.
Since Mime Mail and drupal_mail_send() will take care of this, I think it would be better to remove the mime_header_encode() call from Simplenews.
Please try to remove the function call and see if that works, if it does, I think we can move this issue to Simplenews.
Comment #2
BerdirAh, exactly the information I was looking for (that core does encode headers too), will be fixed in #1387648: Sender name is MIME-encoded twice.
Comment #3
caktux CreditAttribution: caktux commentedWith Simplenews not encoding the sender name, the whole From header gets encoded if Mime Mail receives a string, making it look like it was encoded twice...
Comment #4
maximpodorov CreditAttribution: maximpodorov commentedI confirm this problem with Cyrillic letters in From: header.
Comment #5
drikc CreditAttribution: drikc commentedI have tried to make an exception for the 'from' and 'sender' header property so that they use the method shown in the example for the mb_encode_mimeheader() function: http://php.net/manual/fr/function.mb-encode-mimeheader.php
Comment #6
xalexas CreditAttribution: xalexas commentedThis is also a problem in 7.x-1.x-dev.
From field looks like this:
=?UTF-8?B?IlNraWphbGnFoXRhIFNyYmlqZSIgPG1hcmtldGluZ0Bza2lqYWxpc3Rhc3JiaWo=?=.=?UTF-8?B?ZS5ycz4=?=@nhpbox11.eunet.rs <=?UTF-8?B?IlNraWphbGnFoXRhIFNyYmlqZSIgPG1hcmtldGluZ0Bza2lqYWxpc3Rhc3JiaWo=?=.=?UTF-8?B?ZS5ycz4=?=@nhpbox11.eunet.rs>
Comment #7
sgabe CreditAttribution: sgabe commentedWhat if we just check if the header is already MIME-encoded? The attached patch is against D7.
Comment #8
sgabe CreditAttribution: sgabe commentedThought the previous patch is wrong (there will be no newline character at the end), I am still wondering how this can happen when mime_header_encode() will only encode strings that contain non-ASCII characters...
Comment #9
Devin Carlson CreditAttribution: Devin Carlson commentedI recently ran into this issue and found out that it is a duplicate of #84883: Unicode::mimeHeaderEncode() doesn't correctly follow RFC 2047.