change the fucntion : function simplenews_set_from(&$mail, $tid = NULL) :

$mail->from_name = variable_get('simplenews_from_name_'. $tid, $name_default);
to
$mail->from_name = mime_header_encode(variable_get('simplenews_from_name_'. $tid, $name_default));

and

$mail->from_name = variable_get('simplenews_from_name', $name_default);
to
$mail->from_name = mime_header_encode(variable_get('simplenews_from_name', $name_default));

Comments

sutharsan’s picture

Version: 5.x-1.1 » 6.x-2.x-dev
Assigned: Unassigned » sutharsan
Status: Active » Needs review
miro_dietiker’s picture

Assigned: sutharsan » miro_dietiker
Status: Needs review » Postponed (maintainer needs more info)

Checkout drupal core function:
http://api.drupal.org/api/drupal/includes--mail.inc/function/drupal_mail...
http://api.drupal.org/api/drupal/includes--unicode.inc/function/mime_hea...

If not using mimemail or some alternative drupal_mail_wrapper, drupal itself encodes the headers in the sending process drupal_mail_send. Thus a mail wrapper module needs to encode it correctly by itself.

With this API definition / function i consider it wrong to encode parts before. It looks to me, simplenews does it perfectly right. Am i wrong?

miro_dietiker’s picture

Mimemail for example does header encoding in:
drupal_mail_wrapper -> mimemail -> mimemail_mailengine -> mime_header_encode

Encoding is also done by:
mimemail_rfc_headers
mimemail_address -> mime_header_encode
mimemail_headers -> mime_header_encode

However we might hit a ToDo in mimemail_address - if addresses get input as a string.

simon georges’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

No answer to this, I agree to close it now.
Reopen if you can bring something new to the discussion.