Date: 11/20/00
- Next message: hholzgra <email protected>: "[PHP-DEV] PHP 4.0 Bug #7891 Updated: make fails"
- Previous message: John Wright: "Re: [PHP-DEV] .lib file for a Win32 compile"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
ID: 6104
Updated by: jmoore
Reported By: Alan <email protected>
Status: Closed
Bug Type: *General Issues
Assigned To:
Comments:
Sounds like an incorrect popen call to me (Its returning false not -1) try this instead:
$mail = popen($default->path_to_sendmail." -i -f$from --
$recipients", 'w');
This should fix this. If it doesnt please reopen with a smaller reproducing script and full system info. Also try the latest CVS to see if that fixes it.
Previous Comments:
---------------------------------------------------------------------------
[2000-08-11 06:23:11] Alan <email protected>
This code snippit from horde.lib (www.horde.org):
// Finally, send the mail.
if ( <email protected>($default->path_to_sendmail)) {
$mail = popen("$default->path_to_sendmail -i -f$from -- $recipients", 'w');
$result = fputs($mail, $bhdrs . $hdrs);
echo "1: " . $result;
$result += fputs($mail, "n"); // trailing n to end the
headers section
echo "2: " . $result;
$result += fputs($mail, $body);
echo "3: " . $result;
if (pclose($mail) != 0)
$result = 0;
echo "4: " . $result;
} else {
if (empty($envelope['To'])) $envelope['To'] = '';
if (empty($envelope['Subject'])) $envelope['Subject'] = '';
if (mail($envelope['To'], $envelope['Subject'], $body, $hdrs .
$mhdrs))
$result = 1;
else
$result = 0;
}
Yields the following output:
1: 345
2: 346
3: 354
4: 0
The return value of pclose() is not the exit status of the program, but a value as returned by waitpid() of wait4(). I've run what the popen command-line calls by hand using truss, and sendmail is returning exit(0). So, I dug a bit further... pclose($mail) is returning -1. Any ideas on how I can track down why? This function is not reported to be misbehaving on other platforms.
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=6104
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: hholzgra <email protected>: "[PHP-DEV] PHP 4.0 Bug #7891 Updated: make fails"
- Previous message: John Wright: "Re: [PHP-DEV] .lib file for a Win32 compile"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

