[Watford] PHP - mail() function

walt walt at helvatron.co.uk
Mon Dec 3 09:41:19 GMT 2007


Thanks Alain,

I was looking for the logs but Linux is like a rabbit warren, I can never
find anything or I have to read reams of stuff to track it down. Which is
why I asked the question,  are there any logs somewhere.

I am using a web form to access sendmail via mail().

On the other hand I have found a command that allows testing of sendmail:
 /usr/sbin/sendmail -bv -v -oL10 recipient at domain.net
I ran it and it tells me that sendmail is functional that the address is
deliverable using my ISPs relay host.

If I then tried the next test:
	/usr/sbin/sendmail -v  walt at helvatron.co.uk
	This is a test
	.
I get:
walt at helvatron.co.uk... Connecting to [127.0.0.1] via relay...
220 linux-01.helvatron ESMTP Sendmail 8.14.1/8.14.1/SuSE Linux 0.8; Mon, 3
Dec 2007 08:49:55 GMT
>>> EHLO linux-01.helvatron
250-linux-01.helvatron Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-AUTH DIGEST-MD5
250-DELIVERBY
250 HELP
>>> MAIL From:<root at linux-01.helvatron> SIZE=15 AUTH=root at linux-01.helvatron
250 2.1.0 <root at linux-01.helvatron>... Sender ok
>>> RCPT To:<walt at helvatron.co.uk>
>>> DATA
250 2.1.5 <walt at helvatron.co.uk>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 lB38ntvG004568 Message accepted for delivery
walt at helvatron.co.uk... Sent (lB38ntvG004568 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 linux-01.helvatron closing connection

And after all that I managed to track down the log under /var/log/mail which
contains no entries about mail() attempting to connect.

I have no idea yet where to look for the queue (MTA) file/folder/logs.  

There are 2 php.ini, /etc/php5/apache2  &  /etc/php5/cli.  I am assuming its
the one in apache2 I need to change and I have set 'error_reporting=E_ALL' .

Thanks again for your assistance.

Walter
-----Original Message-----
From: watford-bounces at mailman.lug.org.uk
[mailto:watford-bounces at mailman.lug.org.uk] On Behalf Of Alain Williams
Sent: 02 December 2007 21:49
To: watford at mailman.lug.org.uk
Subject: Re: [Watford] PHP - mail() function

On Sun, Dec 02, 2007 at 09:29:15PM -0000, walt wrote:
> Hi,
> 
> I cannot get this work.  I followed the instructions, replaced postfix
with
> sendmail, set it up and tested it with telnet localhost smtp as well as
with
> evolution and mails are sent and received.
> 
> But the PHP mail() function wont work. Dont know where the mail goes
either.
> Is there a log somewhere that tells me whether the mail() function has
> attempted to connect to sendmail smtp?
> 
> I have checked the web and this is not unusual, by all accounts.  None of
> the fixes I have seen there work though. If there is way round this I'd
like
> to know.

How are you running php mail(), via a web form or interactively ?
If on a web form check the log files. Is error_reporting in your php.ini
set to maximum ?

mail() passes mail to the MTA, is there something in the mail queue ?
What do the MTA logs say ?

-- 
Alain Williams
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT
Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/
Parliament Hill Computers Ltd. Registration Information:
http://www.phcomp.co.uk/contact.php
Chairman of UKUUG: http://www.ukuug.org/
#include <std_disclaimer.h>

_______________________________________________
Watford mailing list
Watford at mailman.lug.org.uk
https://mailman.lug.org.uk/mailman/listinfo/watford




More information about the Watford mailing list