the PHP mail function has 5 parameters: to, subject, body, headers, params.
drupal_mail() @ common.inc only uses the first 4 which might be a trouble to those who are using shared hosting and need to specify an additional parameter like '-fsite@example.com' and doesnt want to modify the core.

Comments

Veggieryan’s picture

+1
what are the implications of committing this to core?
seems like standard stuff.
without this fix mail gets lost in the spam queue on shared host.
seems pretty important.

my fix:
(in includes/common.inc line 1991)

//full header fix
    $extraparam='-f'. $defaults['Reply-To'];
    return mail(
      $to,
      mime_header_encode($subject),
      str_replace("\r", '', $body),
      join("\n", $mimeheaders),
      $extraparam
    );
damien tournoud’s picture

Status: Active » Closed (won't fix)

Well, Drupal cannot guess what are the parameters needed for your specific environment. The solution implemented works in standard cases, and Drupal also provides a pluggable SMTP Library. You can change the way Drupal work by implementing the drupal_mail_wrapper() function, see [1].

There is no need to hack Core here, so marking as won't fix.

[1] http://api.drupal.org/api/function/drupal_mail/5