php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15796 mail() doesn't work with qmail
Submitted: 2002-02-28 17:28 UTC Modified: 2002-05-23 13:05 UTC
From: ted at tedlove dot com Assigned:
Status: Not a bug Package: Mail related
PHP Version: 4.1.2 OS: RedHat 7.2
Private report: No CVE-ID: None
 [2002-02-28 17:28 UTC] ted at tedlove dot com
On my apache 1.3.23 and php 4.1.2 system the mail() function does not send mail, although the local mail system (QMail) is functioning in every other capacity.  I have tried the suggestions of changing the "sendmail_path" to:
/usr/sbin/sendmail
/var/qmail/bin/sendmail
and 
/var/qmail/bin/qmail-inject
(I have also tried the sendmail wrapper commands with -t and qmail-inject with -h)
This short script segment:

if (mail($to, $sub, $body)){
print ("MAIL SENT");
} else {
print ("MAIL DIED");
}

always returns "MAIL DIED".
Qmail logs and mail logs show nothing.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-28 19:42 UTC] yohgaki@php.net
The bug system is not the appropriate forum for asking support
questions. For a list of a range of more appropriate places to ask
for help using PHP, please visit http://www.php.net/support.php
 [2002-05-23 12:48 UTC] ffeingol at webmasters-resources dot com
I've been having the exact same problem (4.1.2 and 4.2.1).  I did not post the bug yet because I can not determine for sure that it's a PHP problem.

It appears that PHP is not able to open the pipe to qmail.  I'm having the exact same problem with exec().
 [2002-05-23 13:05 UTC] rasmus@php.net
The php.net servers run qmail and mail() has always worked just fine.
 [2002-05-23 13:17 UTC] ted at tedlove dot com
After many hours of looking at this problem, I finally did get it to work.  I believe the problem is in how you build the packages.  i.e. I built apache from source and qmail from RPM.
When I start apache with the following script, php mail() function works:
#!/bin/bash
export QMAILMFTFILE=/tmp/.lists && apachectl start

I had seen the QMAILMFTFILE fix posted elsewhere, but didn't realize it needed to be in the APACHE path.  I have no idea why this fixes anything, but it does.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC