ID: 28976
Comment by: alexhuang at anet dot net dot tw
Reported By: kdaniel at aosepc dot com
Status: Open
Bug Type: Mail related
Operating System: Windows\Apache
PHP Version: 4.3.6
New Comment:
Please try to make a copy of "c:\winnt\php.ini" to "c:\php".
After I copied the file, no more error messages.
Previous Comments:
------------------------------------------------------------------------
[2004-11-11 04:38:29] jpablo at dld dot net
The same happens with 4.3.7
------------------------------------------------------------------------
[2004-11-04 16:53:59] Charlesk at netgaintechnology dot com
It seems to me that this was thought of but never implemented. In
sendmail.c:
if (headers) {
char *pos = NULL;
size_t i;
/* Use PCRE to trim the header into the right format */
if (NULL == (headers = php_win32_mail_trim_header(headers
TSRMLS_CC))) {
*error = W32_SM_PCRE_ERROR;
return FAILURE;
}
/* Create a lowercased header for all the searches so we're
finally
case
* insensitive when searching for a pattern. */
if (NULL == (headers_lc = estrdup(headers))) {
efree(headers);
*error = OUT_OF_MEMORY;
return FAILURE;
}
for (i = 0; i < strlen(headers_lc); i++) {
headers_lc[i] = tolower(headers_lc[i]);
}
}
/* 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;
}
I would think that in the if (headers) section there should be some
code to set the mailRPath if the From header is found in headers. That
way when it falls into the if (mailRPath && *mailRPath) section it will
appropriately assign the from to the return path.
Can this be fixed soon?
Thanks
Charles
------------------------------------------------------------------------
[2004-08-24 19:53:10] dv at josheli dot com
http://marc.theaimsgroup.com/?l=php-dev&m=109286883222906&w=2
------------------------------------------------------------------------
[2004-08-23 19:19:30] kdaniel at aosepc dot com
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
------------------------------------------------------------------------
[2004-08-23 19:02:33] joe at inexo dot com
It's not coming from php.ini.
------------------------------------------------------------------------
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