]> granicus.if.org Git - php/commitdiff
- Revert fix for #14407. The From: header field IS different from the
authorMarkus Fischer <mfischer@php.net>
Sun, 2 Jun 2002 22:54:48 +0000 (22:54 +0000)
committerMarkus Fischer <mfischer@php.net>
Sun, 2 Jun 2002 22:54:48 +0000 (22:54 +0000)
  sendmail_from field which is in fact the retturn path.

win32/sendmail.c

index 15cb78cd9c5e6ccb3c1d51ecc45cffa5956246c3..28d26d23d0fcb84b5929c028bcc168234ab8c4a2 100644 (file)
@@ -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 */