ID:               28976
 User updated by:  kdaniel at aosepc dot com
 Reported By:      kdaniel at aosepc dot com
 Status:           Open
 Bug Type:         Mail related
 Operating System: Windows\Apache
 PHP Version:      4.3.6
 New Comment:

Yes it is.  The problem exists in sendmail.c

The code as follows:

/* Fall back to sendmail_from php.ini setting */
        if (mailRPath && *mailRPath) {
                RPath = estrdup(mailRPath);
        }
        else if (INI_STR("sendmail_from")) {
                RPath = estrdup(INI_STR("sendmail_from"));
        } else {
                if (headers) {
                        efree(headers);
                        efree(headers_lc);
                }
                *error = W32_SM_SENDMAIL_FROM_NOT_SET;
                return FAILURE;
        }

Should be changed to:

/* Fall back to sendmail_from php.ini setting */
        if (mailRPath && *mailRPath) {
                RPath = estrdup(mailRPath);
        }
        else if (INI_STR("sendmail_from")) {
                RPath = estrdup(INI_STR("sendmail_from"));
        } else {
                if (headers) {
                        efree(headers);
                        efree(headers_lc);
                } else {
                        *error = W32_SM_SENDMAIL_FROM_NOT_SET;
                        return FAILURE;
                }
        }


I have not tested this, it is just a guess.

Kevin


Previous Comments:
------------------------------------------------------------------------

[2004-08-23 19:02:33] joe at inexo dot com

It's not coming from php.ini.

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

[2004-08-18 23:07:34] dv at josheli dot com

using cli PHP 5 and latest snap (php5-win32-200408181430), the extra
"From:" header does not seem to work.

test.php:
<?php
mail('[EMAIL PROTECTED]','subject','body',"From: [EMAIL PROTECTED]");
?>

Warning: mail(): "sendmail_from" not set in php.ini or custom "From:"
header missing in C:\dev\quiktests\test.php on line 3

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

[2004-08-06 21:39:27] kdaniel at aosepc dot com

I don't see how that is possible because there is no way for the mail
server to pick up the sendmail_from ini setting.  PHP has to be using
it somewhere.  There needs to be a way to disable its use.

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

[2004-08-06 19:27:15] [EMAIL PROTECTED]

I'm pretty sure that this header is added by the SMTP mail server and
not by PHP itself. PHP first writes the generated headers to
the SMTP stream, followed by any additional_headers you passed to
mail(). Any headers following those you passed as additional_headers
have been added by the transporting mail server (s). Looks like it is
adding the SMPT "MAIL FROM" into Return_Path:

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

[2004-07-21 04:04:12] kdaniel at aosepc dot com

Yes, PHP is picking up the sendmail_from ini setting and sticking it
into the mime headers as Return-Path.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/28976

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

Reply via email to