ID: 43348
User updated by: RQuadling at GMail dot com
Reported By: RQuadling at GMail dot com
Status: Assigned
Bug Type: Mail related
Operating System: Windows XP SP2
PHP Version: 5.3CVS-2007-11-20 (snap)
Assigned To: johannes
New Comment:
Nuno,
if (!sendmail_path || !*sendmail_path)
works for me on 5.3 CVS. Not tested HEAD as I've not got ICU yet.
Richard.
Previous Comments:
------------------------------------------------------------------------
[2008-04-20 00:49:21] scottmac@php.net
Nuno I posted about the underlying change that broke this to internals
last week.
It's potentially broken in more places that relied on INI_STR to turn
NULL as it now returns "".
------------------------------------------------------------------------
[2008-04-19 23:59:46] nlopess@php.net
a better fix is:
if (!sendmail_path || !*sendmail_path)
let me know if you want me to commit this.
------------------------------------------------------------------------
[2008-04-17 14:45:55] RQuadling at GMail dot com
Hi.
I have finally managed to get php to compile for windows (yippee for
me).
So I can now try and get mail() working again.
The issue is that in ext/standard/mail.c (/* $Id: mail.c,v
1.87.2.1.2.7.2.3 2007/12/31 07:17:15 sebastian Exp $ */), line 197,
the test of ...
if (!sendmail_path)
always evaluates to false when there is no sendmail_path which would
be the case on windows.
The next line differentiates between processing for windows/netware
and everything else.
If the test is
if(0 == strlen(sendmail_path))
then that would work.
The INI_STR call in Line 194 always returns a string if the directive
is known (doesn't need to be set, just has to exist as a directive).
So, I've attached a patch which I have compiled and tested on Windows.
This is in relation to bug http://bugs.php.net/bug.php?id=43348
Index: mail.c
===================================================================
RCS file: /repository/php-src/ext/standard/mail.c,v
retrieving revision 1.87.2.1.2.7.2.3
diff -u -u -r1.87.2.1.2.7.2.3 mail.c
--- mail.c 31 Dec 2007 07:17:15 -0000 1.87.2.1.2.7.2.3
+++ mail.c 17 Apr 2008 14:40:33 -0000
@@ -194,7 +194,7 @@
char *sendmail_path = INI_STR("sendmail_path");
char *sendmail_cmd = NULL;
- if (!sendmail_path) {
+ if (0 == strlen(sendmail_path)) {
#if (defined PHP_WIN32 || defined NETWARE)
/* handle old style win smtp sending */
if (TSendMail(INI_STR("SMTP"), &tsm_err, &tsm_errmsg,
headers,
subject, to, message, NULL, NULL, NULL TSRMLS_CC) == FAILURE) {
------------------------------------------------------------------------
[2007-12-04 16:50:44] RQuadling at GMail dot com
Just to iterate, the mail function for windows in the CVS is broken for
CLI, CGI and ISAPI.
------------------------------------------------------------------------
[2007-12-04 15:54:42] pipaff at comptrio dot com
Update: Switched back to CGI and mail works again... lost the ability
to 'except users' from safe_mode in Apache config
(php_admin_value/flag), but mail works.
This is on a Linux box CentOS4... 2.6.9 kernel
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/43348
--
Edit this bug report at http://bugs.php.net/?id=43348&edit=1