cvs: php4 /win32 sendmail.c

From: Date: Sun, 02 Jun 2002 22:54:51 +0000
Subject: cvs: php4 /win32 sendmail.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12204@lists.php.net to get a copy of this message
mfischer Sun Jun 2 18:54:51 2002 EDT Modified files: /php4/win32 sendmail.c Log: - Revert fix for #14407. The From: header field IS different from the sendmail_from field which is in fact the retturn path. Index: php4/win32/sendmail.c diff -u php4/win32/sendmail.c:1.36 php4/win32/sendmail.c:1.37 --- php4/win32/sendmail.c:1.36 Sun Jun 2 18:10:25 2002 +++ php4/win32/sendmail.c Sun Jun 2 18:54:48 2002 @@ -17,7 +17,7 @@ * */ -/* $Id: sendmail.c,v 1.36 2002/06/02 22:10:25 mfischer Exp $ */ +/* $Id: sendmail.c,v 1.37 2002/06/02 22:54:48 mfischer Exp $ */ #include "php.h" /*php specific */ #include <stdio.h> @@ -137,7 +137,6 @@ strcpy(MailHost, host); } - /* use from address as return path (if specified in headers) */ if (headers) { char *pos = NULL; size_t i; @@ -150,39 +149,17 @@ for (i = 0; i < strlen(headers_lc); i++) { headers_lc[i] = tolower(headers_lc[i]); } - /* Try to match 'from:' only at start of the string or after following a \r\n */ - if (strstr(headers_lc, "\r\nfrom:")) { - pos = strstr(headers_lc, "\r\nfrom:") + 7; /* Jump over the string "\r\nfrom:", hence the 7 */ - } else if (!strncmp(headers_lc, "from:", 5)) { - pos = headers_lc + 5; /* Jump over the string "from:", hence the 5 */ - } - if (pos) { - char *pos_end; - /* Let pos point to the real header string */ - pos = headers + (pos - headers_lc); - /* Ignore any whitespaces */ - while (pos && ((*pos == ' ' || *pos == '\t'))) - pos++; - /* Match until \r\n or end of header string */ - if (pos_end = strstr(pos, "\r\n")) { - RPath = estrndup(pos, pos_end - pos); - } else { - RPath = estrndup(pos, strlen(pos)); - } - } } /* Fall back to sendmail_from php.ini setting */ - if (!RPath) { - if (INI_STR("sendmail_from")) { - RPath = estrdup(INI_STR("sendmail_from")); - } else { - if (headers_lc) { - efree(headers_lc); - } - *error = W32_SM_SENDMAIL_FROM_NOT_SET; - return FAILURE; + if (INI_STR("sendmail_from")) { + RPath = estrdup(INI_STR("sendmail_from")); + } else { + if (headers_lc) { + efree(headers_lc); } + *error = W32_SM_SENDMAIL_FROM_NOT_SET; + return FAILURE; } /* attempt to connect with mail host */

« previous php.cvs (#12204) next »