#28748 [Com]: mail() resource problem
| From: | papercrane at reversefold dot com | Date: | Mon, 14 Jun 2004 16:39:18 +0000 |
| Subject: | #28748 [Com]: mail() resource problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-60895@lists.php.net to get a copy of this message | ||
ID: 28748
Comment by: papercrane at reversefold dot com
Reported By: karthur at kzoo dot edu
Status: Wont fix
Bug Type: iPlanet related
Operating System: Solaris 8
PHP Version: 4.3.6
New Comment:
If you continue to have this problem, you may want to look into a
package which implements mailing in PHP code, such as:
http://pear.php.net/package/Mail
Previous Comments:
------------------------------------------------------------------------
[2004-06-14 15:44:16] karthur at kzoo dot edu
Thanks for the quick feedback. However, we have a similar problem with
exec so the suggested work-around won't help.
I'm going to try to rewrite mail.c to use sfio from AT&T. The downside
is that I'll then have to reimplement that fix everytime we upgrade
php. I can share the code I come up with if anyone is interested. If
it does work, then I'll try to look more into the exec function as
well.
If it doesn't work then another work-around I thought of is to have php
write the email to a file and then have a cron-scheduled system script
pass the file off to sendmail.
------------------------------------------------------------------------
[2004-06-12 22:31:45] thetaphi@php.net
This problem is well known and a problem of Solaris in all versions.
For PHP 4.3.4 we ported a lot of code from PHP5 back to eliminate
fopen(),... Scripts now start without any problems (until PHP 4.3.3
even this could fail). But there are still a lot of extensions that use
stdio functions.
A solution would be to write a temporary file with the complete mail
(headers and text) and then execute: exec("/bin/sh -c
\"/usr/lib/sendmail -t </tmp/mail.txt\"").
------------------------------------------------------------------------
[2004-06-12 19:07:13] karthur at kzoo dot edu
Upon further searching this sounds like bug report 25195
which had no solution given. Any chance someone has
discovered a work-around for this?
------------------------------------------------------------------------
[2004-06-11 23:40:17] karthur at kzoo dot edu
Description:
------------
mail() stops working a few minutes after Sunone 6 web server starts,
which makes this look like a resource problem...
Config line: "./configure --with-mysql=/usr/local/mysql
--with-nsapi=/home/netscape/servers --enable-track-vars --enable-libgcc
--with-ldap"
Note that mail() does work briefly after web server is restarted so it
doesn't seem to be a configuration problem.
Reproduce code:
---------------
<?php
mail("karthur@kzoo.edu", "Test Subject", "Test Body");
?>
Expected result:
----------------
expect to receive an email
Actual result:
--------------
no email received
I get no php or system errors but the following error shows up in the
IPlanet logs:
"trying to GET /is/sys
net/test/email.php, php4_execute reports: PHP Warning: mail(): Could
not execute
mail delivery program '/usr/lib/sendmail -t'"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28748&edit=1