my sent emails are arriving with the "from" address in the format: "myaccount@box555@bluehost.commyaddress@mysite.com"
mail sent with mimemail latest dev version.
(posted also in mimemail issues, since not sure cause)

Comments

docwilmot’s picture

i would be grateful for comment on this issue please.

mas10’s picture

I am the same situation, too. But I do not put mimemail.

sutharsan’s picture

Status: Active » Postponed (maintainer needs more info)

This is not likely to be caused by Simplenews. Check the From address when using the core contact form.

docwilmot’s picture

hello sutharsan
it is likely partly due to simplenews though.

however, on further review, this only happens in windows live mail.

this happens when i send simplenews with mimemail
doesnt happen with simplenews without mimemail
but doesnt happen with print.module sent with mimemail
doesnt happen with contact form with mimemail off (disabled),
doesnt happen contact form with site using mimemail for all mail.

in short, this only happens with mimemail and simplenews together in WLM

i changed the newsletter "from name" at admin/content/simplenews/types and at admin/settings/simplenews/newsletter to the same as the "from email". now i dont get the box..bluehost, but the email from line in WLM shows as "from email [from email]"

good enough for now but not ideal. would be nice to have "from name[from email]."

and would be nice at least to know why this happens.

thanks

sutharsan’s picture

Status: Postponed (maintainer needs more info) » Active

If you want to go to the bottom of this, you have to debug the code.
Try using the Devel module, that has an option to log the outgoing email to the watchdog, including the email header fields. That will help you investigating the content of the email sent by Mime Mail. Have you searched the Mime Mail issue queue. This now seems to be a Mime Mail issue.

robbiethegeek’s picture

I can confirm that the server email address is what it is sent from on the block form subscription submission. And the contact form sends with the proper email address from the site default.

These are print_r output from in :

drupal_send_mail 
    watchdog('error', print_r($mimeheaders, TRUE));
    return mail(...)
Array ( [0] => MIME-Version: 1.0 [1] => Content-Type: text/plain;
charset=UTF-8; format=flowed; delsp=yes [2] =>
Content-Transfer-Encoding: 8Bit [3] => X-Mailer: Drupal [4] =>
Errors-To: info@americanbard.org [5] => Return-Path:
info@americanbard.org [6] => Sender: info@americanbard.org [7] => From:
"American Bard Theater Company" )
Array ( [0] => MIME-Version: 1.0 [1] => Content-Type: text/plain;
charset=UTF-8; format=flowed; delsp=yes [2] =>
Content-Transfer-Encoding: 8Bit [3] => X-Mailer: Drupal [4] =>
Errors-To: info@americanbard.org [5] => Return-Path:
info@americanbard.org [6] => Sender: info@americanbard.org [7] => From:
robbiethegeek@gmail.com ) 

it doesn't seem to pass through the email address that would have been newsletter@americanbard.org which I confirmed before drupal_mail_send() gets called within drupal_mail().

sutharsan’s picture

Assigned: Unassigned » sutharsan
sutharsan’s picture

@robbiethegeek: Your system uses the server address because a From address is missing. The From is "American Bard Theater Company" instead of "American Bard Theater Company". Please continue debugging:

simplenews_subscribe_user() [956] Handles subscription and sending upon simplenews block submission.
$params['from'] = _simplenews_set_from(); [999] Is where the From address is collected as an array. Should contain:
$parms['from']['address'] = from@example.com
$parms['from']['formatted'] = "_mime_encoded_from_name_" <from@example.com>

simplenews_mail() [1460] Builds all simplenews emails; newsletter and confirmation emails.
$headers['From'] = $params['from']['formatted']; [1520] Is where the From email header is made.

[edit] all above wrapped in <code> tags.

robbiethegeek’s picture

Status: Active » Postponed (maintainer needs more info)

I can give you whatever you want to help debug, what exact dumps of variables do you want?

sutharsan’s picture

You should watch the content of the formatted from addres and when it looses its email address component.

ssg13565’s picture

I have been debugging on this for a couple of days before I discovered this topic. My problem also involves bluehost as the host for my domain.

The from address that I get is:

From:  "Hayloft Steppers Square Dance Club" <xxxxxxx@box539.bluehost.com>
    <webmaster@hayloftsteppers.org>

I have put in some debugging messages into simplenews and get the following output:

  • Executing simplenews_mail_mail.
  • From is "Hayloft Steppers Square Dance Club" <webmaster@hayloftsteppers.org>.
  • Executing mimemail_address.
  • Address is a string '"Hayloft Steppers Square Dance Club" <webmaster@hayloftsteppers.org>'.
  • In mimemail_rfc_headers for key = 'Content-Type', value is 'text/plain; charset=utf-8'.
  • In mimemail_rfc_headers for key = 'Content-Disposition', value is 'inline'.
  • In mimemail_rfc_headers for key = 'Content-Transfer-Encoding', value is '8bit'.
  • In mimemail_rfc_headers for key = 'Content-Type', value is 'text/html; charset=utf-8'.
  • In mimemail_rfc_headers for key = 'Content-Disposition', value is 'inline'.
  • In mimemail_rfc_headers for key = 'Content-Transfer-Encoding', value is '8bit'.
  • In mimemail_rfc_headers for key = 'Content-Type', value is 'multipart/alternative; boundary="xxxxxxxxxxxxxxxxxxx"'.
  • In mimemail_rfc_headers for key = 'Content-Disposition', value is 'inline'.
  • In mimemail_rfc_headers for key = 'Content-Transfer-Encoding', value is '8bit'.
  • In mimemail_prepare, sender is '"Hayloft Steppers Square Dance Club" <webmaster@hayloftsteppers.org>'.
  • Executing mimemail_address.
  • Address is a string 'steve@ssgreenberg.name'.
  • In mimemail_headers from is '"Hayloft Steppers Square Dance Club" <webmaster@hayloftsteppers.org>'.
  • In mimemail_headers from_email is 'webmaster@hayloftsteppers.org'.
  • Sending message from mimemail_mailengine.
  • Message['headers'] are 'Array'.
  • In mimemail_rfc_headers for key = 'Return-Path', value is 'webmaster@hayloftsteppers.org'.
  • In mimemail_rfc_headers for key = 'Errors-To', value is 'webmaster@hayloftsteppers.org'.
  • In mimemail_rfc_headers for key = 'From', value is '"Hayloft Steppers Square Dance Club" <webmaster@hayloftsteppers.org>'.
  • In mimemail_rfc_headers for key = 'Content-Type', value is 'multipart/alternative; charset=utf-8; boundary="abdd32e5ee071f26a1742c0d2eee4087"'.
  • In mimemail_rfc_headers for key = 'MIME-Version', value is '1.0'.
  • In mimemail_rfc_headers for key = 'Content-Transfer-Encoding', value is '8Bit'.
  • In mimemail_rfc_headers for key = 'X-Mailer', value is 'Drupal'.
  • In mimemail_rfc_headers for key = 'Sender', value is 'webmaster@hayloftsteppers.org'.
  • In mimemail_rfc_headers for key = 'Precedence', value is 'bulk'.
  • In mimemail_rfc_headers for key = 'List-Unsubscribe', value is '<http://www.hayloftsteppers.org/newsletter/confirm/remove/xxxxxxxxxxxxxxx>'.
  • Test newsletter sent to steve@ssgreenberg.name.
  • Newsletter issue December 14, 2009 - xxxxxxxx has been updated.

There is no indication of bluehost in anything that simplenews passes to the PHP mail function.

I just found out that only if I leave the from name blank, then the from address that appears in the email is:

From:  "" <webmaster@hayloftsteppers.org>

and has no hint of the bluehost email account.

sutharsan’s picture

Category: bug » support
Status: Postponed (maintainer needs more info) » Active

ssg13565, do you have a windows based webserver? It is known that windows based systems don't accept the from name.

In simplenews I use the code below. Although your address is (?) composed by Mime Mail it may be usefull to you.

  // Windows based PHP systems don't accept formatted emails.
  $formatted_address = substr(PHP_OS, 0, 3) == 'WIN' ? $address : '"'. mime_header_encode($name) .'" <'. $address .'>';
sutharsan’s picture

@robbiethegeek: are you still open to debug this?

sutharsan’s picture

Assigned: sutharsan » Unassigned
Status: Active » Closed (fixed)

No activity, closing the issue.