Mail() does not function on FreeBSD and PHP and Qmail or Postfix
From: Jurgy (jurgen)
Date: 10/31/04
- Next message: crub: "perl style in php ?"
- Previous message: SteveJ: "Extract records from HTML of another site"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 31 Oct 2004 16:05:26 +0100
I have a problem with the PHP mail() function on a running Qmail
server
on FreeBSD 5.2.1. Pretty like this problem, I found in the mail
archive :
http://lists.freebsd.org/pipermail/freebsd-questions/2003-August/017231.html
Please, can somebody help me out. With this problem and the PHP mail()
function.
OS : FreeBSD 5.2.1
Mailserver: Qmail
PHP : 5.0.2 (4.3.9 same error)
Step 1: Testing of the qmail server in shell:
I create a test.eml file with:
<snip>
Message-ID: <802973227.20041027110037@person.be>
Date: Wed, 27 Oct 2004 11:00:37 +0200
From: me <me@mydomain.loc>
To: me2@mydomain.loc
Subject: Local test
Helleuu.
</snip>
I test the mailserver from shell with:
cat test.eml | /var/qmail/bin/qmail-inject (mail arrives)
cat test.eml | /usr/sbin/sendmail -t -i (mail arrives)
Step 2: I deinstalled the whole bunch of PHP 4.3.9 with:
pkg_delete -x "php4*"
pkg_delete -x "pecl-*"
rm -d -r /usr/local/lib/php /usr/local/include/php
Step 3: Install minimum PHP system.
cd /usr/ports/lang/php5
make WITH_APACHE=yes PHP_SAPI=full
make WITH_APACHE=yes PHP_SAPI=full install
Step 4: Configure right php.ini and verify it works
cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
Change
;sendmail_path
into
sendmail_path = /var/qmail/bin/qmail-inject
(note: same behaviour when i use, or I use ; before sendmail)
sendmail_path = /usr/sbin/sendmail -t -i
qmail-inject can be accessed and executed from others.
Write a test.php with
<?
phpinfo();
?>
# php -v
PHP 5.0.2 (cli) (built: Oct 31 2004 11:12:24) (DEBUG)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.2, Copyright (c) 1998-2004 Zend Technologies
(Ok next time i try WITH_DEBUG=no)
#php -m
[PHP Modules]
libxml
SPL
Standard
#php -f test.php | grep sendmail_path
sendmail_path => /var/qmail/bin/qmail-inject =>
/var/qmail/bin/qmail-inject
(Ok, seems OK)
Step 5: testing mail from PHP
A simple test2.php:
<?
mail("me@mydomain.loc", "Subjet", "Test mail");
?>
#php -f test2.php
->Same results, the script sits waiting/running whatever.
No core dumped, it just runs and waits...
--
\I/
/(@ @)\ Greetings from CyBy
---o00-(_)-00o--------------------
- Next message: crub: "perl style in php ?"
- Previous message: SteveJ: "Extract records from HTML of another site"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|