No route to host and Connection timed out

adamanyn asked:

I try to install Postfix to use it with PHP.
I did the installation with this tutorial:
how-to-get-php-mail-working-on-ubuntu-16-04

I sent an email but nothing happens.
When I look to mail.log, I get this (I replaced my real domain by example):

Jun 19 00:36:57 example postfix/pickup[95929]: 5ABA44055E: uid=1000 from=<[email protected]>
Jun 19 00:36:57 example postfix/cleanup[95953]: 5ABA44055E: message-id=<[email protected] .com>
Jun 19 00:36:57 example postfix/qmgr[94011]: 5ABA44055E: from=<[email protected]>, size=353, nrcpt=1 (queue active)
Jun 19 00:37:27 example postfix/smtp[95955]: connect to gmail-smtp-in.l.google.com[74.125.133.27]:25: Connection timed out
Jun 19 00:37:27 example postfix/smtp[95955]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c09::1b]:25: No route to host
Jun 19 00:37:27 example postfix/smtp[95955]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:4013:c08::1b]:25: No route to host

With syslog :

Jun 19 00:36:57 example postfix/pickup[95929]: 5ABA44055E: uid=1000 from=<[email protected]>
Jun 19 00:36:57 example postfix/cleanup[95953]: 5ABA44055E: message-id=<[email protected]>
Jun 19 00:36:57 example postfix/qmgr[94011]: 5ABA44055E: from=<[email protected]>, size=353, nrcpt=1 (queue active)
Jun 19 00:37:27 example postfix/smtp[95955]: connect to gmail-smtp-in.l.google.com[74.125.133.27]:25: Connection timed out
Jun 19 00:37:27 example postfix/smtp[95955]: connect to gmail-smtp-in.l.google.com[2a00:1450:400c:c09::1b]:25: No route to host
Jun 19 00:37:27 example postfix/smtp[95955]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:4013:c08::1b]:25: No route to host
Jun 19 00:37:57 example postfix/smtp[95955]: connect to alt1.gmail-smtp-in.l.google.com[172.217.218.26]:25: Connection timed out
Jun 19 00:38:27 example postfix/smtp[95955]: connect to alt2.gmail-smtp-in.l.google.com[209.85.233.26]:25: Connection timed out
Jun 19 00:38:27 example postfix/smtp[95955]: 5ABA44055E: to=<[email protected]>, relay=none, delay=90, delays=0.01/0.01/90/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[209.85.233.26]:25: Connection timed out)

Here I don’t know what to do.

Whats does No route to host means ?

Thank you for your help.

My answer:


Your hosting provider has blocked outgoing SMTP traffic on port 25. This is why you get "Connection timed out" messages when trying to connect to the SMTP port on IPv4 addresses.

You get the message "No route to host" when trying to connect to IPv6 addresses because your computer does not have global IPv6 connectivity. This could be either because your hosting provider does not offer it, or you did not set it up on your computer. Even if you did set it up, it would still be subject to your provider’s block on outgoing SMTP traffic.

Contact your provider for more information.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.