diff options
author | Markus Fischer <mfischer@php.net> | 2002-06-02 22:54:48 +0000 |
---|---|---|
committer | Markus Fischer <mfischer@php.net> | 2002-06-02 22:54:48 +0000 |
commit | d497ca147e895dffba1bbd07a981f0d71914cd3c (patch) | |
tree | 47d7a4c67b72fd31acc2eea28b492fbd2fedea49 /win32/sendmail.c | |
parent | 1ec78a1e18aa6e67ece80c0368605ada1ccc152b (diff) | |
download | php-git-d497ca147e895dffba1bbd07a981f0d71914cd3c.tar.gz |
- Revert fix for #14407. The From: header field IS different from the
sendmail_from field which is in fact the retturn path.
Diffstat (limited to 'win32/sendmail.c')
-rw-r--r-- | win32/sendmail.c | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/win32/sendmail.c b/win32/sendmail.c index 15cb78cd9c..28d26d23d0 100644 --- a/win32/sendmail.c +++ b/win32/sendmail.c @@ -137,7 +137,6 @@ int TSendMail(char *host, int *error, char **error_message, 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 @@ int TSendMail(char *host, int *error, char **error_message, 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 */ |