LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 09-23-2006, 04:56 PM   #1
jon23d
Member
 
Registered: May 2006
Location: Kennewick, WA - USA
Distribution: Ubuntu
Posts: 129

Rep: Reputation: 15
php mail() takes too long and doesn't send


In /etc/php5/apache2/php.ini I have sendmail_path set to /usr/sbin/sendmail. This is the correct location for that binary. The script:

<?
mail ('my email address', 'test', 'test');
echo 'test';
?>

It takes about a minute for the script to execute and the mail never sends. I've restarted apache, changed the sendmail path from its' default of blank to /usr/sbin/sendmail. still nothing.
 
Old 09-23-2006, 05:43 PM   #2
jon23d
Member
 
Registered: May 2006
Location: Kennewick, WA - USA
Distribution: Ubuntu
Posts: 129

Original Poster
Rep: Reputation: 15
My computer's name is jonnyD, this used to be the first two lines of /etc/hosts

127.0.0.1 localhost
127.0.1.1 jonnyD

I changed the 2nd line to:

127.0.1.1 jonnyD jonnyD.jonnyD.net

I don't know why, but all of a sudden my scripts are executing instantly and I'm getting a true response from the mail() command; however, the mails are still not actually getting through...

I'm just running this off of my local system. I just need a reliable test environment...

Last edited by jon23d; 09-23-2006 at 05:44 PM.
 
Old 09-23-2006, 06:04 PM   #3
jon23d
Member
 
Registered: May 2006
Location: Kennewick, WA - USA
Distribution: Ubuntu
Posts: 129

Original Poster
Rep: Reputation: 15
This is driving me crazy, I cannot seem to get any mail out. So... I changed /etc/hosts to:

127.0.0.1 localhost
127.0.1.1 jonnyD jonnyD.jonnyD.net
127.0.1.1 jonnyD.jonnyD.net localhost

Then I ran /sbin/sendmailconfig again. I tried to send a mail and this was the output in mail.log:

Sep 23 16:00:48 jonnyD sm-mta[13332]: starting daemon (8.13.5.20060308): SMTP+queueing@00:10:00
Sep 23 16:01:24 jonnyD sendmail[13355]: k8NN1Odw013355: from=www-data, size=39, class=0, nrcpts=1, msgid=<200609232301.k8NN1Odw013355@jonnyD.jonnyD.net>, relay=www-data@localhost
Sep 23 16:01:24 jonnyD sm-mta[13356]: k8NN1OjM013356: from=<www-data@jonnyD.jonnyD.net>, size=323, class=0, nrcpts=1, msgid=<200609232301.k8NN1Odw013355@jonnyD.jonnyD.net>, proto=ESMTP, daemon=MSP-v4, relay=localhost [127.0.0.1]
Sep 23 16:01:24 jonnyD sendmail[13355]: k8NN1Odw013355: to=jon@bsolid.com, ctladdr=www-data (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30039, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (k8NN1OjM013356 Message accepted for delivery)
Sep 23 16:01:27 jonnyD sm-mta[13358]: STARTTLS=client, relay=mail.bsolid.com., version=TLSv1/SSLv3, verify=FAIL, cipher=AES256-SHA, bits=256/256
Sep 23 16:01:27 jonnyD sm-mta[13358]: k8NN1OjM013356: to=<jon@bsolid.com>, ctladdr=<www-data@jonnyD.jonnyD.net> (33/33), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120323, relay=mail.bsolid.com. [70.84.129.68], dsn=5.1.1, stat=User unknown
Sep 23 16:01:28 jonnyD sm-mta[13358]: k8NN1OjM013356: k8NN1SjM013358: DSN: User unknown
Sep 23 16:01:28 jonnyD sm-mta[13358]: k8NN1SjM013358: to=<www-data@jonnyD.jonnyD.net>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
to send mail with php Nau Linux - Software 3 02-28-2006 08:39 PM
coding problem on php auto send mail after a period akamaru607 Programming 12 09-01-2005 07:48 AM
POSTFIX: Changed SMTP port - now can't send mail (long) cnjvh Linux - Software 1 07-13-2004 01:40 PM
Cannot send mail with mail() command in PHP 4.3.4, Apache 2.0.48, Mandrake Linux 10 arcanum Linux - General 3 06-27-2004 06:06 PM
send mail via PHP from website on apache. not working mdkelly069 Linux - Software 0 02-25-2004 12:15 PM


All times are GMT -5. The time now is 01:52 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration