Discussion:
Connection timed out
(too old to reply)
Daniel Watrous
2015-02-19 14:49:51 UTC
Permalink
Hi,

I am running an Ubuntu server inside virtualbox on Windows (created using Vagrant). The server is configured to run a LEMP stack and I would like the mail function in PHP to work, so I installed postfix.

Unfortunately it won't send any email. Here's the command line I ran to send a test email.

***@vagrant-ubuntu-trusty-64:~$ echo "This is the body of the email" | mail -s "This is the subject line" ***@gmail.com

Here are the logs:
Feb 19 14:41:09 vagrant-ubuntu-trusty-64 postfix/pickup[10527]: BE65C408C6: uid=1000 from=<***@vagrant-ubuntu-trusty-64>
Feb 19 14:41:09 vagrant-ubuntu-trusty-64 postfix/cleanup[10904]: BE65C408C6: message-id=<***@vagrant-ubuntu-trusty-64>
Feb 19 14:41:09 vagrant-ubuntu-trusty-64 postfix/qmgr[10528]: BE65C408C6: from=<***@vagrant-ubuntu-trusty-64>, size=409, nrcpt=1 (queue active)
Feb 19 14:41:39 vagrant-ubuntu-trusty-64 postfix/smtp[10906]: connect to gmail.com[74.125.21.19]:25: Connection timed out
Feb 19 14:42:09 vagrant-ubuntu-trusty-64 postfix/smtp[10906]: connect to gmail.com[74.125.21.17]:25: Connection timed out
Feb 19 14:42:39 vagrant-ubuntu-trusty-64 postfix/smtp[10906]: connect to gmail.com[74.125.21.83]:25: Connection timed out
Feb 19 14:43:09 vagrant-ubuntu-trusty-64 postfix/smtp[10906]: connect to gmail.com[74.125.21.18]:25: Connection timed out
Feb 19 14:43:09 vagrant-ubuntu-trusty-64 postfix/smtp[10906]: BE65C408C6: to=<***@gmail.com>, relay=none, delay=120, delays=0.01/0/120/0, dsn=4.4.1, status=deferred (connect to gmail.com[74.125.21.18]:25: Connection timed out)

I have found a lot of people with the same issue, but none of the solutions mentioned have helped. I would appreciate any assistance you can offer.
Daniel Watrous
2015-02-20 01:30:02 UTC
Permalink
I'm pretty sure the culprit here is Comcast, blocking port 25.

I ended up using ssmtp with a throwaway gmail account.
Burkhard Ott
2015-02-20 02:21:57 UTC
Permalink
Post by Daniel Watrous
I'm pretty sure the culprit here is Comcast, blocking port 25.
I ended up using ssmtp with a throwaway gmail account.
Yup, but you should better leave comcast, unless you are happy to pay the
full fee for half the service.

cheers
a***@gravitant.com
2015-02-23 15:29:07 UTC
Permalink
See if Comcast offers you a SMTP Smarthost relay to send out. Often, there are limitations such as only sending for specific FROM domains (if they offer their own). Maybe a call to their support (may your sanity be saved!) will get the block lifted, but it's not likely.

Also, GMail does some fairly rigorous checks for spam, so you should at the least make sure that your FROM domain is legit (vagrant-ubuntu-trusty-64 is not), and that the domain's SPF record allows you to send out.

If you would like reliable mail, you may want to use Google's authenticated SMTP server as describe here:
https://www.digitalocean.com/community/tutorials/how-to-use-google-s-smtp-server

Postfix support using SMTP auth. I've had good luck with this guide (it's for Amazon's SES service, but the config is the same, just change the server hostname to be Google's):
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/postfix.html


Good luck!

Continue reading on narkive:
Loading...