I believe that there should be no space after the "-f" flag when using sendmail. This will cause issues on some servers causing emails not to be sent.

usage: sendmail [-f] [-t] [-s] [-p
] [-T] [-v] [address ...]

-----

if (isset($message['Return-Path']) && !ini_get('safe_mode')) {
$mail_result = mail(
$message['to'],
$mail_subject,
$mail_body,
$mail_headers,
// Pass the Return-Path via sendmail's -f command.
'-f ' . $message['Return-Path']
);
}

Comments

bfroehle’s picture

Status: Active » Needs review
StatusFileSize
new463 bytes

Originated in #131737: Ensure that the Return-Path is set when sending mail on both Windows and non-Windows systems..

The lack of space between -f and the email address is consistent with Drupal contributed modules like returnpath. (See returnpath.module, for example).

It is not consistent with other programs like phpMailer as sun points out in #131737-25: Ensure that the Return-Path is set when sending mail on both Windows and non-Windows systems..

I have not thoroughly tested this.

AndrewEchidna’s picture

Sorry, this is the first issue I've ever identified. - do I have to do anything with this?

bfroehle’s picture

andrewchidna: It'd probably be nice to know what operating system, php version, sendmail version, etc you are using. Whether things work with and without the space after the -f, etc.

AndrewEchidna’s picture

After the space is removed, the mail function works correctly.

PHP Version 5.2.14
This is all I could get from phpinfo as I don't manage the server. Sorry.

pillarsdotnet’s picture

Title: Problem with DefaultMailSystem::mail » There should be no space between the "-f" flag and the return-path address.
Version: 7.x-dev » 8.x-dev
StatusFileSize
new930 bytes

Bumping, re-rolling, and tagging as per standard policy.

bfroehle’s picture

Issue tags: +Needs backport to D7

And tagging, maybe?

pillarsdotnet’s picture

star-szr’s picture

What else (if anything) needs to be done here, in order to get this into the next D7 release?

pillarsdotnet’s picture

@#8: This issue needs to be reviewed by a senior Drupal developer and the status upgraded from needs review to reviewed and tested by the community.

Then it needs to sit in limbo until webchick or Dries work through the 200+ issues ahead of it in the queue.

pillarsdotnet’s picture

pillarsdotnet’s picture

pillarsdotnet’s picture

star-szr’s picture