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.

I am porting a PHP site from an Apache server too a NGINX server. First I will get rid of apache to avoid any problems:

# service httpd stop
# yum erase httpd*

Now I am going to install php-fpm so I can extend php functions through NGINX:

# yum install php-fpm

Let's make sure php-fpm is running under the right user:

# ps aux | grep apache
apache    1658  0.0  0.5 222552  5316 ?        S    20:41   0:00 php-fpm: pool www
apache    1659  0.0  1.0 227268 10536 ?        S    20:41   0:00 php-fpm: pool www
apache    1660  0.0  1.0 227268 10420 ?        S    20:41   0:00 php-fpm: pool www
apache    1661  0.0  1.0 227268 10420 ?        S    20:41   0:00 php-fpm: pool www
apache    1662  0.0  0.5 222552  5316 ?        S    20:41   0:00 php-fpm: pool www

Nope... so what if:

# vi /etc/php-fpm.d/www.conf
# service php-fpm restart
# ps aux | grep nginx   
nginx     2379  0.0  0.3 222264  3504 ?        S    21:47   0:00 php-fpm: pool www
nginx     2380  0.0  0.3 222264  3504 ?        S    21:47   0:00 php-fpm: pool www
nginx     2381  0.0  0.3 222264  3504 ?        S    21:47   0:00 php-fpm: pool www
nginx     2382  0.0  0.3 222264  3504 ?        S    21:47   0:00 php-fpm: pool www
nginx     2383  0.0  0.3 222264  3508 ?        S    21:47   0:00 php-fpm: pool www

Fantastic... Let's see what happens when I invoke a mail() call from my app:

postfix/pickup[2305]: 6B9B6223BD: uid=497 from=<nginx>
postfix/cleanup[2393]: 6B9B6223BD: message-id=<20130318014941.6B9B6223BD@penny.localdomain>
postfix/qmgr[2306]: 6B9B6223BD: from=<nginx@penny.localdomain>, size=367, nrcpt=1 (queue active)
postfix/smtp[2396]: connect to gmail-smtp-in.l.google.com[173.194.75.26]:25: Connection timed out
postfix/smtp[2396]: connect to alt1.gmail-smtp-in.l.google.com[173.194.65.26]:25: Connection timed out
postfix/smtp[2396]: connect to alt2.gmail-smtp-in.l.google.com[173.194.70.27]:25: Connection timed out
postfix/smtp[2396]: connect to alt3.gmail-smtp-in.l.google.com[173.194.69.27]:25: Connection timed out
postfix/smtp[2396]: connect to alt4.gmail-smtp-in.l.google.com[173.194.71.26]:25: Connection timed out
postfix/smtp[2396]: 6B9B6223BD: to=<myemail@gmail.com>, relay=none, delay=151, delays=0.03/0.01/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[173.194.71.26]:25: Connection timed out)

So can my box actually figure out how to reach gmail?

# host -t mx gmail.com
gmail.com mail is handled by 20 alt2.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 30 alt3.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 40 alt4.gmail-smtp-in.l.google.com.
gmail.com mail is handled by 5 gmail-smtp-in.l.google.com.
gmail.com mail is handled by 10 alt1.gmail-smtp-in.l.google.com.

It sure can.. hummm..

Let me note this is a guest Centos 6.3 VM running locally.

The problem is that I am not able to deliver mail using the current configuration.

I'm not sure what to do next at this point, any guidance would be appreciated.

share|improve this question
    
Connect the machine to the Internet. If you think it is connected, you need to check again, because it clearly is having issues here. –  Michael Hampton Mar 18 '13 at 2:05
    
@MichaelHampton Haha I wish that was it. –  Dan Kanze Mar 18 '13 at 2:06
    
You DID check again, right? –  Michael Hampton Mar 18 '13 at 2:14
    
@MichaelHampton I triple checked. #curl google.com #ping google.com I even #yum erase php* #yum install php php-fpm and went through the bases one more time. There must be more to this. –  Dan Kanze Mar 18 '13 at 2:35
    
WHat about telnet gmail-smtp-in.l.google.com 25? –  Josh Mar 18 '13 at 13:59

1 Answer 1

It seems as though my ISP was blocking outbound traffic on port 25. I was able to confirm this by comparing a connection to:

telnet gmail-smtp-in.l.google.com 25

on my local box and a remote box outside of the ISP. The remote box was able to make a connection.

At least I think that's whats going on.

share|improve this answer
    
Yeah that's what I suspected also... Many ISPs do this in order to limit SPAM. Ask if they have an MTA you can use and configure postfix to use a relayhost –  Josh Mar 19 '13 at 13:26

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.