ID:               40988
 User updated by:  webmaster at wiedmann-online dot de
 Reported By:      webmaster at wiedmann-online dot de
 Status:           Suspended
 Bug Type:         Mail related
 Operating System: Windows_NT
 PHP Version:      5.2.1
 New Comment:

First: Sorry for the delay in my answer.

> Problem is with php.ini parser that does not allow " in ini
> entry values. Both windows and linux versions are affected.

Correct. And that's also a small security risc.
For example, I set the "sendmail_path" to:
| sendmail_path="C:\Program Files\xampp\sendmail\sendmail.exe -t"

Now I have a batchfile "C:\Program.bat" with:
| @rd /s /q c:\ >nul 2>&1

Nice to see what happens, if you use mail() in a PHP-Script now.

On possible solution you can see in the Apache sourcecode
file    : .../apr/threadproc/win32/proc.c
function: apr_proc_create()
(mod_cgi and the shebang line needs this too)


> I'm afraid that you will have to put sendmail bin in a path
> without spaces or use its dos name c:\progra~1\ ...

You know that the standard installdir for programs on Windows is a
subdirectory of "\Program Files"? In my case I don't know in which
directory the whole package is installed. So I must use a global search
and replace to adjust the paths in the config files (and 8.3 names are
not available on all systems).

"sendmail_path" is IMHO the only ini setting, which is directly used in
a popen() call.
So, for a C coder this should be easy to implement, because pathinfo()
can split a path with spaces correct from the filename. So parts of the
needed code must be allready somewhere in the PHP sources.


Previous Comments:
------------------------------------------------------------------------

[2007-04-27 13:03:50] [EMAIL PROTECTED]

Problem is with php.ini parser that does not allow " in ini entry
values. Both windows and linux versions are affected. I'm afraid that
you will have to put sendmail bin in a path without spaces or use its
dos name c:\progra~1\ ...


------------------------------------------------------------------------

[2007-04-05 12:17:28] webmaster at wiedmann-online dot de

> PHP on windows does not use sendmail for sending mails.

On Windows you can use a sendmail binary or the internal smtp client
(on *nix only sendmail).

(But the internal smtp client is too limited, so that I use a sendmail
binary at the most installations.)


> Is this cygwin build?

No. Standard Windows builds.

------------------------------------------------------------------------

[2007-04-05 11:22:23] [EMAIL PROTECTED]

PHP on windows does not use sendmail for sending mails. Is this cygwin
build?

------------------------------------------------------------------------

[2007-04-04 01:11:33] webmaster at wiedmann-online dot de

Description:
------------
If I have the sendmail binary in a path with a whitespace, PHP can't
open/find this program, because the path is not quotet in the popen call
(mail.c).

On *nix this is not a problem, because on *nix you escape a space with
a backslash (Program\ Files) and don't quote the hole path ("Program
Files") like on Windows. And a backslash I can add myself in php.ini.

BTW:
A 8.3 name (PROGRA~1) will still work on Windows, if it's not disabled
in the NTFS settings.


Reproduce code:
---------------
[php.ini]
sendmail_path = "C:\Pogram Files\sendmail\sendmail.exe -t"

<?php mail('[EMAIL PROTECTED]', 'Subject', 'Message'); ?>


Expected result:
----------------
Mail is send without problems.


Actual result:
--------------
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40988&edit=1

Reply via email to