ID: 25862
Updated by: [email][/email]
Reported By: thouraud at bondy dot ird dot fr
-Status: Open
+Status: Wont fix
Bug Type: Mail related
Operating System: solaris 9
PHP Version: 4.3.3
New Comment:

When PHP is compiled with --enable-sigchild the return codes of
executed programs are lost. Once of those programs is sendmail, since
PHP cannot fetch the return code it assumes the program had failed.
Hence the always FALSE return value of mail(). Normally mail() returns
false only when communication between PHP & sendmail fails.

Previous Comments:

[2003-10-14 13:05:24] thouraud at bondy dot ird dot fr

Without the --enable-sigchild configure option, it seems that mail()
alwayes return TRUE.

Even if the mail server returns an "unknown error" with a false email,
or an "No recipients specified" with a blank first field of mail().

Is that normal ? When mail() returns FALSE ?


[2003-10-14 11:13:37] [email][/email]

Okay, try removing the --enable-sigchild configure option
and reconfigure/compile PHP. (don't forget to delete config.cache
before reconfiguring!)


[2003-10-14 10:44:48] thouraud at bondy dot ird dot fr

the configure line is :

../configure --with-apxs=/opt/apache/bin/apxs --prefix=/opt/apache
--with-config-file-path=/opt/apache/conf --with-mysql --disable-debug
--enable-trans-sid --with-oci8=/opt/oracle/product/9201 --enable-dbase
--enable-safe-mode --disable-magic-quotes --enable-sigchild
--enable-ldap --with-zlib=/opt/sfwplus --enable-mbstring
--enable-mbregex --enable-zend-multibyte --enable-bcmath
--enable-calendar --enable-exif --with-jpeg-dir=/opt/sfwplus
--with-png-dir=/opt/sfwplus --with-tiff-dir=/opt/sfwplus --with-gd
--with-iconv --with-pgsql=/opt/postgres


[2003-10-14 10:34:18] [email][/email]

What was the configure line you used to configure PHP?


[2003-10-14 08:26:31] thouraud at bondy dot ird dot fr

The mail() function always return FALSE.
Even if the mail is sent !

Test with the sun's sendmail and postfix 2.0.16.
The mail can go out with no problem.

The result get the same safe_mode or not.

apache 1.3.28 with php as a module

Reproduce code:
$ret = mail ("userdomain.tld",
"sujet " . date("l dS of F Y h:i:s A"),
"From: [email]userdomain.tld[/email]\r\n"
."Reply-To: [email]userdomain.tld[/email]\r\n"
) ;

print "ret = $ret<hr>" ;
if ($ret) {
print 'OK<br>' ;
} else {
print 'KO<br>' ;


Expected result:
if we can send mail to [email]userdomain.tld[/email]
then OK and [email]userdomain.tld[/email] receive the mail.

if any error to sent mail
then KO and no mail !

Actual result:
always KO

but the mail are been received !


Edit this bug report at [url][/url]