Outgoing emails are not delivered: Connection timed out

Created:

2016-11-16 12:55:16 UTC

Modified:

2017-08-16 15:57:17 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Outgoing emails are not delivered: Connection timed out

Applicable to:

  • Plesk for Linux

Symptoms

Outgoing email messages are not delivered. They are stuck in a mail queue which can be seen at Plesk > Tools & Settings > Mail Server settings > Mail Queue.

  • The following error appears in /var/log/maillog:
    May 1 11:46:02 user postfix/error[303179]: D1E58F0D2F6: to=<mail@example.com>, relay=none, delay=564, delays=475/89/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to alt2.gmail-smtp-in.l.google.com[74.125.130.27]:25: Connection timed out)
    OR
    connect to alt2.gmail-smtp-in.l.google.com[1.2.3.4]:25: Connection timed out
    BF8DD84260: to=, relay=none, delay=90, delays=0.03/0/90/0, dsn=4.4.1, status=de
  • Incoming emails arrive without any issues.
  • Testing connection on port 25 via telnet results in success:
    # telnet alt2.gmail-smtp-in.l.google.com 25
    Trying 74.125.130.27...
    Connected to alt2.gmail-smtp-in.l.google.com.
    Escape character is '^]'.
    220 mx.google.com ESMTP e28si1653007plj.30 - gsmtp

Cause

  • Incorrect IP address is specified for outgoing mail mode at Plesk > Tools & Settings > Mail Server Settings.
  • Incorrect MX records set for the server hostname.
  • Postfix is not able to route emails through a domain IP address, because it is not configured properly. It can be checked by connecting to a remote mail server from a domain IP address:
    # telnet alt2.gmail-smtp-in.l.google.com 25 -b 203.0.113.2
    Trying 74.125.137.27...
  • Server firewall is blocking a connection.

Resolution

  1. Set a correct IP address (usually the main Plesk IP address) for an outgoing mail mode at Plesk > Tools & Settings > Mail Server Settings.
  2. If the solution above does not help, add the following value for smtp_bind_address parameter in the file /etc/postfix/master.cf:
    # grep smtp_bind_address /etc/postfix/master.cf
    203.0.113.2- unix - n n - - smtp -o smtp_bind_address=203.0.113.2 -o smtp_bind_address6= -o smtp_address_preference=ipv4
    For more information, see the KB article: How to configure the IP address for outgoing mail in Postfix.
  3. Correct MX record(s) in DNS settings: it(they) should point to the same IP that SMTP is assigned to.

If everything is configured correctly in Postfix and DNS settings, check a server firewall using the command iptables -L

Have more questions? Submit a request
Please sign in to leave a comment.