Bug #73934 [Fbk]: Envelope Sender (-f) no longer working?

From: Date: Sun, 15 Jan 2017 16:40:53 +0000
Subject: Bug #73934 [Fbk]: Envelope Sender (-f) no longer working?
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-206633@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73934&edit=1

 ID:                 73934
 Updated by:         yohgaki@php.net
 Reported by:        core905 at gmail dot com
 Summary:            Envelope Sender (-f) no longer working?
 Status:             Feedback
 Type:               Bug
 Package:            Mail related
 PHP Version:        7.1.0
 Block user comment: N
 Private report:     N

 New Comment:

I guess you have

mail.force_extra_parameters = 'something'

or something like this in your INI. Comment the ini setting out like

;mail.force_extra_parameters = 

to disable this INI.

If you don't have access to INI settings, e.g. php_admin_value, check the INI setting value by
phpinfo() or ini_get_all().


Previous Comments:
------------------------------------------------------------------------
[2017-01-14 18:16:50] cmb@php.net

Also consider to use something like sendmail_path=echo for
debugging.

------------------------------------------------------------------------
[2017-01-14 15:44:48] requinix@php.net

There have not been any changes to mail() in PHP 7.1 so far. Are you sure that your MTA is honoring
the -f parameter? What if you try using sendmail and -f from the command line?

------------------------------------------------------------------------
[2017-01-14 12:44:08] core905 at gmail dot com

Description:
------------
I notice in PHP 7.0 when using mail() it is able to set the envelope-from (i believe this is also
known as: Return-Path?) when i make use of the $additional_parameters field using "-f". 
But in PHP7.1 this no longer works.




Test script:
---------------
$to      = "to@email.com";
$from    = "from@email.com";
$subject = "my subject";
$message = "my body";
$headers = "From: $from" . "\r\n" . "Reply-To: $from" .
"\r\n" . "Return-Path: $from" . "\r\n" . "X-Mailer: PHP/" .
phpversion();
$params  = "-f$from";

mail($to, $subject, $message, $headers, $params);

Expected result:
----------------
the envelope-from (and return-path) doesnt match the "From" field in php7.1.  It shows the
servers own outgoing address not the one i gave for the from field.  

But when using the same test script in php7.0 it does match the from field and everything is
correct.



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=73934&edit=1


Thread (9 messages)

« previous php.bugs (#206633) next »