Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

A web server that has successfully sent mail using the hosting providers's SMTP server before seems to suddenly have lost connection to the SMTP server.

[Wed Nov 28 09:51:27 2012] [error] [client 10.250.11.81] PHP Warning:  fsockopen(): unable to connect to smtp.ourprovider.net:25 (Connection timed out) in /var/www/(....)/phpmailer/class.smtp.php on line 105, referer: http://oursite.net/sendmessage.php#

If I telnet to the SMTP server's port 25 manually from the web server, I'm able to connect and send mail with no problems whatsoever.

The web server is running RHEL 6.3 and Apache 2.2.15. The SE boolean httpd_can_network_connect is on. Our PHP version is 5.3.3.

Where should I start looking to fix this?

share|improve this question
    
Start with dig smtp.ourprovider.net. If this returns more than one IP address, you will have to check connectivity to each of them. It's possible that PHP is trying one and your telnet is trying a different one. Also, is this timeout happening a lot or just once? –  Ladadadada Nov 28 '12 at 10:19
    
@Ladadadada: Why yes, it does return two IP addresses and the other one isn't responding. Thank you! Could you repost your comment as an answer so I can accept it? –  Kaivosukeltaja Nov 28 '12 at 10:38
    
Heh, didn't actually expect to get it right on my first guess. Done. –  Ladadadada Nov 28 '12 at 10:45
add comment

1 Answer

up vote 1 down vote accepted

Start with dig smtp.ourprovider.net. If this returns more than one IP address, you will have to check connectivity to each of them. It's possible that PHP is trying one and your telnet is trying a different one.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.