Bug #17310 Updated: mail() function has problems with sendmail 8.12
| From: | rasmus@php.net | Date: | Mon, 20 May 2002 16:52:18 +0000 |
| Subject: | Bug #17310 Updated: mail() function has problems with sendmail 8.12 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-8003@lists.php.net to get a copy of this message | ||
ID: 17310
Updated by: rasmus@php.net
Reported By: glen@broadpool.com
Status: Feedback
Bug Type: Mail related
Operating System: FreeBSD 4.6-RC #5
PHP Version: 4.2.1
New Comment:
Nowhere in the mail() code do we do a chdir(). We fetch the
sendmail_cmd as configured in the php.ini file, play a bit with the
mail() function arguments to get them into the right format and then we
open a pipe to the configured sendmail_cmd using a popen() call. Then
we fprintf() the data to that open pipe and finally pclose(). If
something is doing a chdir() it is not PHP.
Previous Comments:
------------------------------------------------------------------------
[2002-05-20 12:46:45] mfischer@php.net
Ok, let's see what we can do here. Btw, I still think it's an issue not
related to PHP.
However, try to strace the PHP binary and see if it's really doping the
chdir() itself
------------------------------------------------------------------------
[2002-05-20 12:44:15] glen@broadpool.com
Not true. I've confirmed all the sendmail settings, including the
setuid bit for the sendmail group. For some reason, something in PHP is
trying to chdir to /var/spool/mqueue, which is owned by root and does
not have group/world read or write permissions. The problem ONLY occurs
with PHP mail().
------------------------------------------------------------------------
[2002-05-20 12:35:30] mfischer@php.net
This is a configuration issue with Sendmail, not with PHP. PHP is just
invoking the sendmail binary (which probably isn't setuid for
/var/spool/mqueue).
------------------------------------------------------------------------
[2002-05-20 11:13:36] glen@broadpool.com
I recently upgraded my server to PHP 4.1.2 and sendmail 8.12. Once both
upgrades were complete, I can no longer send mail using the PHP mail()
function.
sendmail 8.12 introduced a number a security features. Among these are
the fact that the mail queue directory (/var/spool/mqueue) is now has
the permissions 0700; i.e., it's not readable or writeable by anyone
other than root.
It *appears* (I'm not familiar with PHP internals) that the PHP mail()
function attempts to chdir to the /var/spool/mqueue directory. When I
attempt to send mail using PHP's mail() function, this is the usual
result:
May 20 08:07:10 virgil sendmail[667]: NOQUEUE: SYSER(www): can not
chdir(/var/spool/mqueue/): Permission denied
If I relax the permissions on the mqueue directory, that error goes
away and a queue file is created; however, sendmail now reports that
there is a bogus queue file in the mqueue directory, and refuses to
send it (this is another of sendmail's new security features to prevent
unauthorized mail).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=17310&edit=1