diff -u b/core/includes/mail.inc b/core/includes/mail.inc --- b/core/includes/mail.inc +++ b/core/includes/mail.inc @@ -124,7 +124,6 @@ if (empty($site_mail)) { $site_mail = ini_get('sendmail_from'); } - $from = $site_mail; // Bundle up the variables into a structured array for altering. $message = array( @@ -132,7 +131,7 @@ 'module' => $module, 'key' => $key, 'to' => $to, - 'from' => $from, + 'from' => $site_mail, 'reply-to' => $reply, 'langcode' => $langcode, 'params' => $params, @@ -148,12 +147,10 @@ 'Content-Transfer-Encoding' => '8Bit', 'X-Mailer' => 'Drupal' ); - if ($from) { - // To prevent e-mail from looking like spam, the addresses in the Sender and - // Return-Path headers should have a domain authorized to use the - // originating SMTP server. - $headers['From'] = $headers['Sender'] = $headers['Return-Path'] = $headers['Errors-To'] = $from; - } + // To prevent e-mail from looking like spam, the addresses in the Sender and + // Return-Path headers should have a domain authorized to use the + // originating SMTP server. + $headers['From'] = $headers['Sender'] = $headers['Return-Path'] = $headers['Errors-To'] = $site_mail; if ($reply) { $headers['Reply-to'] = $reply; } @@ -188,7 +185,7 @@ $message['result'] = $system->mail($message); // Log errors. if (!$message['result']) { - watchdog('mail', 'Error sending e-mail (from %from to %to).', array('%from' => $message['from'], '%to' => $message['to']), WATCHDOG_ERROR); + watchdog('mail', 'Error sending e-mail (from %from to %to with reply-to %reply).', array('%from' => $message['from'], '%to' => $message['to'], '%reply' => $message['reply-to'] ? $message['reply-to'] : t('not set')), WATCHDOG_ERROR); drupal_set_message(t('Unable to send e-mail. Contact the site administrator if the problem persists.'), 'error'); } }