Diff against current HEAD for patch for bug #14407. This allows the return path to automatically be set to the from address for Win32 sendmail.
Michael Sisolak [EMAIL PROTECTED] __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com
--- sendmail.c Tue May 14 10:07:40 2002 +++ sendmail.c.new Tue May 14 10:22:13 2002 @@ -125,11 +125,26 @@ strcpy(MailHost, host); } - if (INI_STR("sendmail_from")){ - RPath = estrdup(INI_STR("sendmail_from")); + /* use from address as return path (if specified in headers) */ + if (headers && strstr(headers, "From:")) { + char *pos; + pos = strstr(headers, "From:") + 5; + while (pos && (*pos == ' ')) + pos++; + + if (pos && strlen(pos)) { + RPath = estrdup(pos); + RPath[strcspn(RPath, "\r\n")] = '\x0'; + } + } + + if (!RPath) { + if (INI_STR("sendmail_from")) { + RPath = estrdup(INI_STR("sendmail_from")); } else { *error = W32_SM_SENDMAIL_FROM_NOT_SET; return FAILURE; + } } /* attempt to connect with mail host */
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php