Bug #16201 Updated: sendmail behaves strangely

From: Date: Thu, 21 Mar 2002 10:33:15 +0000
Subject: Bug #16201 Updated: sendmail behaves strangely
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-3036@lists.php.net to get a copy of this message
ID: 16201 Updated by: mfischer@php.net Reported By: rohit.kaul@gecapital.com Status: Open Bug Type: *General Issues Operating System: Solaris 8 PHP Version: 4.1.2 New Comment: Afaik you can't pass multiple parameters separated with spaces (they will be passed as one paramter) because of safe_mode on. Anyone else can confirm this? Previous Comments: ------------------------------------------------------------------------ [2002-03-21 05:21:37] rohit.kaul@gecapital.com We have installed php4.1.2 on iplanet 6.0 Webserver on a Solaris 8 OS. The following config options were used: ./configure' '-enable-sysvshm=yes' '--enable-sysvsem=yes' '--with-nsapi=/ecomm/iplanet/nes60/product' '--enable-libgcc' Something really strange is happening. I have written this piece of code for sending e-mails. ######################################################## <? $locat = "/usr/lib/sendmail"; $rk = "/ecomm/iplanet/nes60/product/docs/rohit/kkmail" ; function doSending($emailFilename) { global $locat; echo "<br> locat ".$locat; echo "<br> emailfilename ".$emailFilename; unset($do); $do = "$locat -oi -t < $emailFilename 2>&1 "; echo " SYSTEM " .$do; exec($do,$ret,$ret_var); echo "return_code " .$ret_var; echo "reta " .$ret[1]; echo "retb " .$ret[2]; echo "retc " .$ret[3]; echo "retd " .$ret[4]; echo "rete " .$ret[5]; echo "retf " .$ret[6]; } doSending($rk); ?> ######################################################## kkmail contents: To: <email@testmail.com> Line1 Line2 Line3 ######################################################## The code works very well when I have: safe_mode=off in php.ini But as soon as I put the following parameters in php.ini and restart the web-server: safe_mode=on safe_mode_exec_dir=/usr/lib (In /usr/lib where we have the sendmail executable). The code displays this error on the php page: locat /usr/lib/sendmail emailfilename /ecomm/iplanet/nes60/product/docs/rohit/kkmailSYSTEM /usr/lib/sendmail -oi -t < /ecomm/iplanet/nes60/product/docs/rohit/kkmail 2>&1 return_code 67 reta <... User unknown retb /ecomm/iplanet/nes60/product/docs/rohit/kkmail... Cannot mail directly to files retc 2>&1... Unbalanced '>' retd 2>&1... User unknown rete /ecomm/iplanet/dead.letter... Saved message in /ecomm/iplanet/dead.letter retf The php.ini file is like this: ######################################################## doc_root=/ecomm/iplanet/nes60/product/docs safe_mode=on safe_mode_exec_dir=/usr/lib expose_php=Off display_errors=off log_errors=On register_globals=off magic_quotes_runtime=On file_uploads=Off allow_url_fopen=Off session.cookie_lifetime=1200 session.cookie_path=/ecomm/iplanet/nes60/product/docs/ivor session.entropy_length=16 session.use_trans_sid=0 session.auto_start=1 ######################################################## Any help would be deeply appreciated. Thanks, Rohit ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=16201&edit=1

« previous php.bugs (#3036) next »