#1  
Old 16th February 2011, 16:10
dvancamp dvancamp is offline
Junior Member
 
Join Date: Mar 2008
Location: Delray Beach, FL
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
Default PHP mail() in queue

Hello,

I have a multiserver setup as outlined in the manual. "Installing A Multiserver Setup With Dedicated Web, Email, DNS And MySQL Database Servers On Debian 5.0 With ISPConfig 3".

When I use a simple php mail() the mail appears to get stuck in the queue of the web server.

Code:
<?php
$message = "Line 1\nLine 2\nLine 3";
$message = wordwrap($message, 70);
mail('me@differentdomain.tld', 'Test Subject', $message);
?>
Code:
7h 1.2K 1Ppc0V-000348-7c <>
web6@web1.domain.net

7h 1.2K 1Ppc6b-00035J-DJ <>
web6@web1.domain.net

7h 1.2K 1Ppc8V-00035d-Fj <>
web6@web1.domain.net

18m 1.2K 1PpiPe-0004P7-Ol <>
web6@web1.domain.net

14m 1.2K 1PpiTE-0004Q3-F2 <>
web6@web1.domain.net

13m 1.2K 1PpiUM-0004QG-TC <>
web6@web1.domain.net

13m 1.2K 1PpiUR-0004QM-7w <>
web6@web1.domain.net

10m 1.2K 1PpiXH-0004Sl-Kr <>
web6@web1.domain.net
Is there some additional configuration that I must do on the webserver in order to get php to send mail reliably? Perhaps the php.ini needs to use the mail server as the smtp instead of trying to send mail through the webserver?

Thanks for all the help, howtos, and this great forum.
Dave
Reply With Quote
Sponsored Links
  #2  
Old 16th February 2011, 17:13
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,446
Thanks: 813
Thanked 5,218 Times in 4,090 Posts
Default

Are there any errors in the mail log?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 16th February 2011, 17:25
dvancamp dvancamp is offline
Junior Member
 
Join Date: Mar 2008
Location: Delray Beach, FL
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
Default

Mail-log
Mail-warn-log
Mail-error-log

Are all blank on this server (web1.domain.net); just the Mail queue filling up with php mail.

The Mail server (mail.domain.net) has an empty queue and no errors. Seems to be working fine.
Reply With Quote
  #4  
Old 16th February 2011, 17:29
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,446
Thanks: 813
Thanked 5,218 Times in 4,090 Posts
Default

Please post the output of:

netstat -tap
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 16th February 2011, 17:47
dvancamp dvancamp is offline
Junior Member
 
Join Date: Mar 2008
Location: Delray Beach, FL
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
Default

Code:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 *:mysql                 *:*                     LISTEN      8437/mysqld     
tcp        0      0 *:ftp                   *:*                     LISTEN      26081/pure-ftpd (SE
tcp        0      0 *:ssh                   *:*                     LISTEN      826/sshd        
tcp        0      0 localhost:smtp          *:*                     LISTEN      8317/exim4      
tcp        0     48 web1.domain.net:ssh     adsl-222-333-444.:57684 ESTABLISHED 18822/sshd: dvancam
tcp6       0      0 [::]:http-alt           [::]:*                  LISTEN      17265/apache2   
tcp6       0      0 [::]:www                [::]:*                  LISTEN      17265/apache2   
tcp6       0      0 [::]:tproxy             [::]:*                  LISTEN      17265/apache2   
tcp6       0      0 [::]:ftp                [::]:*                  LISTEN      26081/pure-ftpd (SE
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      826/sshd        
tcp6       0      0 [::]:https              [::]:*                  LISTEN      17265/apache2
Changed domain name and IP in output...
Reply With Quote
  #6  
Old 16th February 2011, 21:21
dvancamp dvancamp is offline
Junior Member
 
Join Date: Mar 2008
Location: Delray Beach, FL
Posts: 7
Thanks: 0
Thanked 1 Time in 1 Post
Default

O.K. I had a chance to dig around a bit more.

Saw the the local smtp was using exim4. exim4 logs had the errors
Code:
R=nonlocal: Mailing to remote domains not supported
Followed this howto to reconfigure exim:
http://www.howtoforge.com/exim-authenticated-smarthost

(web1.domain.net) was set as "local delivery only; not on a network" changed it to "mail sent by smarthost; no local mail" and used an email username/password to authenticate to the SMTP server on (mail.domain.net).

Getting mail through the PHP webforms on the site now. Still a little unsure of my settings when reconfiguring exim4... Does this sound reasonable?
Reply With Quote
  #7  
Old 17th February 2011, 11:48
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,446
Thanks: 813
Thanked 5,218 Times in 4,090 Posts
Default

Yes, that configuration is ok.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #8  
Old 17th December 2011, 22:21
(O)fer_cz (O)fer_cz is offline
Junior Member
 
Join Date: Sep 2011
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i have same problem, i tried to setup my exim (im not sure its 100% correct, how to is not very detailed...) i used only dpkg-reconfigure exim4-config and i've created new user on mail server and added it to exim config (not user if this is right authentification username pw??)
but i got error:
=FIXED by clearing up panic file=
2011-12-17 22:07:59 socket bind() to port 25 for address XX.XX.XX.XX failed: Cannot assign requested address: daemon abandoned
=FIXED=
how can i make php mail () working on web with multiserver setup?

i have same problem, i tried to setup my exim (im not sure its 100% correct, how to is not very detailed...) i used only dpkg-reconfigure exim4-config
but i got error:

2011-12-17 22:07:59 socket bind() to port 25 for address XX.XX.XX.XX failed: Cannot assign requested address: daemon abandoned

how can i make php mail () working on web with multiserver setup?


root@web1:/tmp# netstat -napt|grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 16255/exim4


root@web1:/tmp# netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:mysql *:* LISTEN 3569/mysqld
tcp 0 0 *:sunrpc *:* LISTEN 2745/portmap
tcp 0 0 *:ftp *:* LISTEN 30301/pure-ftpd (SE
tcp 0 0 *:ssh *:* LISTEN 3429/sshd
tcp 0 0 localhost:smtp *:* LISTEN 16255/exim4
tcp 0 0 *:51261 *:* LISTEN 2757/rpc.statd


=CURRENT PROBLEM=
2011-12-18 00:26:48 1Rc3eS-0004oq-Ah <= root@mydomain.com U=root P=local S=420
2011-12-18 00:26:50 1Rc3eS-0004oq-Ah plain authenticator failed H=mail.mydomain.com [mail server IP] 535 5.7.8 Error: authentication failed:
2011-12-18 00:26:52 1Rc3eS-0004oq-Ah login authenticator failed H=mail.mydomain.com [mail server IP] 535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6
2011-12-18 00:26:52 1Rc3eS-0004oq-Ah ** ssss@yyy.com R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after RCPT TO:<ssss@yyy.com>: host mail.mydomain.com [89.185.250.134]: 554 5.7.1 <ssss@yyy.com>: Relay access denied
2011-12-18 00:26:52 1Rc3eW-0004ot-8z <= <> R=1Rc3eS-0004oq-Ah U=Debian-exim P=local S=1382
2011-12-18 00:26:52 1Rc3eS-0004oq-Ah Completed
2011-12-18 00:26:54 1Rc3eW-0004ot-8z plain authenticator failed H=mail.mydomain.com [mail server IP] 535 5.7.8 Error: authentication failed:
2011-12-18 00:26:56 1Rc3eW-0004ot-8z login authenticator failed H=mail.mydomain.com [mail server IP] 535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6
2011-12-18 00:26:56 1Rc3eW-0004ot-8z ** root@mydomain.com R=smarthost T=remote_smtp_smarthost: SMTP error from remote mail server after RCPT TO:<root@mydomain.com>: host mail.mydomain.com [89.185.250.134]: 554 5.7.1 <root@mydomain.com>: Relay access denied
2011-12-18 00:26:56 1Rc3eW-0004ot-8z Frozen (delivery error message)
root@web1:/tmp#
__________________
IBM Server x3550 797841G, VMWare ESXi 5, Debian 6 Squeeze, ISPConfig 3, multi-server setup

Last edited by (O)fer_cz; 18th December 2011 at 00:49.
Reply With Quote
  #9  
Old 18th December 2011, 15:06
(O)fer_cz (O)fer_cz is offline
Junior Member
 
Join Date: Sep 2011
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok, so i figured this out, i have to authentificate againts user/pass in dbispconfig mail_users, but i dont have any mail domains operated by ISPC (im using google apps), so i cant create username manualy. can i authentificate it agains something else?
__________________
IBM Server x3550 797841G, VMWare ESXi 5, Debian 6 Squeeze, ISPConfig 3, multi-server setup

Last edited by (O)fer_cz; 18th December 2011 at 15:09.
Reply With Quote
  #10  
Old 18th December 2011, 22:29
(O)fer_cz (O)fer_cz is offline
Junior Member
 
Join Date: Sep 2011
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

and i've noticed, that in /var/spool/mail is lot of lot of automated emails from presta shop etc and system messages (see example below), even on my db server, ns server... should this be fixed as well as above? or i've got problem somewhere else?


From root@db.mydomain.com Sun Dec 18 20:51:11 2011
Return-path: <root@db.mydomain.com>
Envelope-to: root@db.mydomain.com
Delivery-date: Sun, 18 Dec 2011 20:51:11 +0100
Received: from root by db.mydomain.com with local (Exim 4.72)
(envelope-from <root@db.mydomain.com>)
id 1RcMlL-0003LX-40
for root@db.simplest.cz; Sun, 18 Dec 2011 20:51:11 +0100
Date: Sun, 18 Dec 2011 20:51:11 +0100
Message-Id: <E1RcMlL-0003LX-40@db.mydomain.com>
To: root@db.mydomain.com
Subject: info: mpt raid status change on db.mydomain.com
From: root <root@db.mydomain.com>

This is a RAID status update from mpt-statusd. The mpt-status
program reports that one of the RAIDs changed state:


Report from /etc/init.d/mpt-statusd on db.mydomain.com
__________________
IBM Server x3550 797841G, VMWare ESXi 5, Debian 6 Squeeze, ISPConfig 3, multi-server setup
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix Problem (Possible Trojan/Spam) bluegrass Server Operation 10 4th August 2010 07:37
Postfix + postfixadmin = SMTP errors... Rashef Server Operation 4 25th June 2009 16:12
procmail can't write Hellbound General 27 8th June 2009 21:51
just the last step...and it works. Postfix...need help config. ubuntusr Installation/Configuration 1 5th January 2009 09:50
Virtual Users And Domains With Postfix, Courier And MySQL (+ SMTP-AUTH, Quota, SpamAs ebbay Installation/Configuration 9 4th March 2006 11:47


All times are GMT +2. The time now is 07:23.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.