Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 29th August 2011, 21:54
Xioyn Xioyn is offline
Junior Member
 
Join Date: Mar 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP Mail Function not working

Hello,

I searched the forums and found this thread and I am having a similar problem but his solution will not work for me.http://www.howtoforge.com/forums/sho...light=mail+php
postqueue -p
Quote:
root@server1:~# postqueue -p
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
62D7D1E4EE 817 Sun Aug 28 23:20:59 www-data@server1.example.com
(connect to alt4.gmail-smtp-in.l.google.com[209.85.143.27]:25: Connection timed out)
robertstanday@gmail.com

B18E51E4EB 851 Sat Aug 27 23:59:06 www-data@server1.example.com
(connect to example.com[192.0.43.10]:25: Connection timed out)
someone@example.com

01B0C1E4ED 851 Sun Aug 28 00:44:36 www-data@server1.example.com
(connect to example.com[192.0.43.10]:25: Connection timed out)
someone@example.com

-- 4 Kbytes in 3 Requests.
dig mx robertday.ca
Quote:
root@server1:~# dig mx robertday.ca

; <<>> DiG 9.7.3 <<>> mx robertday.ca
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18685
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 2

;; QUESTION SECTION:
;robertday.ca. IN MX

;; ANSWER SECTION:
robertday.ca. 629 IN MX 0 smtp.secureserver.net.
robertday.ca. 629 IN MX 10 mailstore1.secureserver.net.

;; ADDITIONAL SECTION:
mailstore1.secureserver.net. 55 IN A 72.167.238.201
smtp.secureserver.net. 280 IN A 216.69.186.201

;; Query time: 20 msec
;; SERVER: 64.59.160.13#53(64.59.160.13)
;; WHEN: Mon Aug 29 11:13:34 2011
;; MSG SIZE rcvd: 126
Now then is this because I haven't set mail up for this website? Or because I named the server server1.example.com

Or is it something else? I tried changing the dns zone on godaddy but it won't accept just my ip address.

Should I reinstall the server with a better name anyway?
Reply With Quote
Sponsored Links
  #2  
Old 29th August 2011, 22:48
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,483
Thanks: 835
Thanked 5,524 Times in 4,345 Posts
Default

Quote:
Or because I named the server server1.example.com
Thats the problem. You should have replaced server1.example.com with the real name of your server during installation. To fix that, edit the files:

/etc/hosts
/etc/hostname
/etc/mailname
/etc/postfix/main.cf

and replace the hostname with the real hostname of your server, e.g. server1.robertday.ca and make sure that server1.robertday.ca exists as dns A-Record in DNS which points to the IP address of your server.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 1st September 2011, 09:58
Xioyn Xioyn is offline
Junior Member
 
Join Date: Mar 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay that worked for 1 email it went into my spam but now it won't send another.
I have attached a screenshot of my GoDaddy DNS manager with the black smudge being the static IP for the server.

Here are postqueue -p and dig mx robertday.ca again.

Quote:
root@server1:~# postqueue -p
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
4CF461E4EF 836 Tue Aug 30 10:17:20 www-data@server1.robertday.ca
(connect to alt4.gmail-smtp-in.l.google.com[209.85.143.27]:25: Connection timed out)
robertstanday@gmail.com

B18E51E4EB 851 Sat Aug 27 23:59:06 www-data@server1.example.com
(connect to example.com[192.0.43.10]:25: Connection timed out)
someone@example.com

01B0C1E4ED 851 Sun Aug 28 00:44:36 www-data@server1.example.com
(connect to example.com[192.0.43.10]:25: Connection timed out)
someone@example.com

-- 4 Kbytes in 3 Requests.


Quote:
root@server1:~# dig mx robertday.ca

; <<>> DiG 9.7.3 <<>> mx robertday.ca
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 39603
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 2

;; QUESTION SECTION:
;robertday.ca. IN MX

;; ANSWER SECTION:
robertday.ca. 3600 IN MX 10 mailstore1.secureserver.net.
robertday.ca. 3600 IN MX 0 smtp.secureserver.net.

;; ADDITIONAL SECTION:
mailstore1.secureserver.net. 89 IN A 72.167.238.201
smtp.secureserver.net. 56 IN A 72.167.238.201

;; Query time: 175 msec
;; SERVER: 64.59.160.13#53(64.59.160.13)
;; WHEN: Wed Aug 31 23:44:32 2011
;; MSG SIZE rcvd: 126
How do I go about removing mail from the queue?
Attached Images
 

Last edited by Xioyn; 1st September 2011 at 10:03. Reason: Upload pic was 2 big
Reply With Quote
  #4  
Old 1st September 2011, 19:20
Ben Ben is offline
Moderator
 
Join Date: Jul 2006
Posts: 1,029
Thanks: 7
Thanked 62 Times in 56 Posts
Default

If i get this right, you are sending mails with in this case a php script, right?

Because looking at the queue message this looks for me like your server does not reach the destination mailserver, as the connections times out.
Did you check your message log for maybe dropped outbound connections?
You may test this via
Quote:
telnet alt4.gmail-smtp-in.l.google.com 25
If you see any response, just enter "quit" and hit enter.

Does sending mails to other recipients work for you? Eventhough I think it does not make a difference, did you try sending to the same thing just via the mail command.

Regarding the queue handling, here's a short manual:

Quote:
#Delete the whole queue:
postsuper -d ALL

#Delete single mails - List quee first and copy the ID of the specific mail:
mailq | less
#delete the specific mail
postsuper -d <QUEUEID>

#Delete mails from or to a specific mailadress:
mailq | tail +2 | awk 'BEGIN { RS = "" } / user@domain\.tld$/ { print $1 } ' | tr -d '*!' | postsuper -d -
Reply With Quote
  #5  
Old 3rd September 2011, 07:10
Xioyn Xioyn is offline
Junior Member
 
Join Date: Mar 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Red face

I just remembered that I am behind a router which is probably the cause of my problems.

Nvm about the ports they are

TCP:20,21,22,25,53,80,110,143,443,3306,8080,8081,1 0000
UDP:53,3306

Taken from the ISP Config Firewall

Last edited by Xioyn; 4th September 2011 at 03:42.
Reply With Quote
  #6  
Old 4th September 2011, 12:59
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
 
Default

If you are on a dynamic IP, you're most likely blacklisted (please check http://www.mxtoolbox.com/blacklists.aspx ), and you should set up relaying: http://www.howtoforge.com/postfix_re...her_mailserver
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
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
ISPconfig 3.0.3.2 postfix not relaying outgoing attachments mychoice2009 Installation/Configuration 3 13th April 2011 18:42
Apache not restart after change php mode wiss Installation/Configuration 15 3rd November 2010 16:43
Postfix + postfixadmin = SMTP errors... Rashef Server Operation 4 25th June 2009 17:12
just the last step...and it works. Postfix...need help config. ubuntusr Installation/Configuration 1 5th January 2009 10:50
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 14:06


All times are GMT +2. The time now is 16:48.


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