note 12822 deleted from function.mail by jimw
| From: | jimw@php.net | Date: | Wed, 31 Oct 2001 23:23:21 +0000 |
| Subject: | note 12822 deleted from function.mail by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-19910@lists.php.net to get a copy of this message | ||
Regarding qmail causing a qmail-inject: fatal: read-error
Technical Explanation:
Normally when a php script run by apache executes, it calls qmail-inject to send the mail. Because
the apache webserver is spawned as the root user, the environment variable for the QMAILMFTFILE
defaults to
$HOME/.lists,i.e. /root/.lists in this case. During runtime, the apache webserver, however, runs as
the 'nobody' user as a member of the 'nobody' group and therefore cannot
traverse the directory tree to
/root/.lists, thus, the apache error file shows qmail-inject: fatal: read-error when apache
attempts to call /var/qmail/bin/qmail-inject. The solution to the problem was to add a line to the
apache startup script
/etc/rc.d/init.d/httpsd to set the QMAILMFTFILE environment variable to point to a file which the
nobody user has permissions to see. In this case, adding QMAILMFTFILE=/tmp/.lists to the startup
script on my server solved the problem.