#40988 [Csd]: Can't use a sendmail_path with whitespace
ID: 40988 User updated by: webmaster at wiedmann-online dot de Reported By: webmaster at wiedmann-online dot de Status: Closed Bug Type: Mail related Operating System: Windows_NT PHP Version: 5.2.1 New Comment: Hi Jani, Fixed in PHP 5.3.0 (by the improved ini handling), you can do this in 5.3.0 and above: Now it was time to test this. That's working. Using a 8.3 pathname is also working in 5.2 and 5.3. If used in php.ini! One thing was not possible to me (5.3.): Setting a long path from command line: php.exe -d sendmail_path='/some path with space/sendmail -t -i' What ever I've tried: - error message (parsing error) - or no error message, but sendmail is not called But IMHO more important: In 5.2 and in 5.3, I also can't not set this path using a 8.3 shortname. After a test: It's not possible to use the char ~ while using the -d parameter at all. Example: | php -n -d user_agent=test~hallo -- parse error in Unknown on line 7 Regards, Carsten Previous Comments: [2007-11-19 14:05:54] j...@php.net Fixed in PHP 5.3.0 (by the improved ini handling), you can do this in 5.3.0 and above: sendmail_path='/some path with space/sendmail -t -i' [2007-04-29 15:14:18] webmaster at wiedmann-online dot de 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 21 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. [2007-04-27 13:03:50] ed...@php.net 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] ed...@php.net PHP on windows does not use sendmail for sending mails. Is this cygwin build? 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/40988 -- Edit this bug report at http://bugs.php.net/?id=40988edit=1
#40988 [Csd]: Can't use a sendmail_path with whitespace
ID: 40988 User updated by: carsten_sttgt at gmx dot de -Reported By: webmaster at wiedmann-online dot de +Reported By: carsten_sttgt at gmx dot de Status: Closed Bug Type: Mail related Operating System: Windows_NT PHP Version: 5.2.1 New Comment: (correcting my email address) Previous Comments: [2009-05-15 11:59:37] webmaster at wiedmann-online dot de Hi Jani, Fixed in PHP 5.3.0 (by the improved ini handling), you can do this in 5.3.0 and above: Now it was time to test this. That's working. Using a 8.3 pathname is also working in 5.2 and 5.3. If used in php.ini! One thing was not possible to me (5.3.): Setting a long path from command line: php.exe -d sendmail_path='/some path with space/sendmail -t -i' What ever I've tried: - error message (parsing error) - or no error message, but sendmail is not called But IMHO more important: In 5.2 and in 5.3, I also can't not set this path using a 8.3 shortname. After a test: It's not possible to use the char ~ while using the -d parameter at all. Example: | php -n -d user_agent=test~hallo -- parse error in Unknown on line 7 Regards, Carsten [2007-11-19 14:05:54] j...@php.net Fixed in PHP 5.3.0 (by the improved ini handling), you can do this in 5.3.0 and above: sendmail_path='/some path with space/sendmail -t -i' [2007-04-29 15:14:18] webmaster at wiedmann-online dot de 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 21 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. [2007-04-27 13:03:50] ed...@php.net 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. 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/40988 -- Edit this bug report at http://bugs.php.net/?id=40988edit=1