|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-05-14 10:02 UTC] mfischer@php.net
[2002-05-17 12:30 UTC] mfischer@php.net
[2002-06-02 18:55 UTC] mfischer@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 05:00:01 2025 UTC |
The SendMail function that is used for Win32 platforms doesn't extract the "From:" header address to use as for the SMTP MAIL FROM command. As a result any mail bounces go to the "sendmail_from" php.ini option instead of to the sender. This is handled correctly in the PostHeader function (which doesn't add "From:" if it is already there), but not in TSendMail. The patch for win32/sendmail.c below allows TSendMail to use the e-mail from address if it is available, and default to the sendmail_from setting otherwise. 124,128c124,142 < < if (INI_STR("sendmail_from")){ < RPath = estrdup(INI_STR("sendmail_from")); < } else { < return 19; --- > > 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 { > return 19; > }