Articles in this section

Emails can not be delivered over IPv6 addresses on Plesk with Digital Ocean

Plesk for Linux kb: technical

Applicable to:

  • Plesk for Linux

Symptoms

  • Email messages can not be sent from a Plesk server on Digital Ocean:

    # egrep "Connection timed out" /var/log/maillog | tail
    example postfix/smtp[16848]: connect to aspmx.l.google.com[2001:db8:f61:a1ff:0:0:0:80]:25: Connection timed out

  • The warning below may appear after the Daily Maintenance task execution in the Tools & Settings > Mail Server Settings or when applying settings in the Domains > example.com > Mail tab > Mail Settings menu:

    PLESK_WARN: You cannot send emails from Plesk because outbound connections on TCP port 25 is blocked. Check the firewall settings or contact your hosting provider. If you are sure that the ports are already open, Plesk can recheck them. Start the recheck.

  • Firewall is configured to allow outgoing traffic via IPv6:

    CONFIG_TEXT: ACCEPT tcp ::/0 ::/0 tcp dpt:25

Cause

SMTP traffic over IPv6 is blocked at the network level on the Digital Ocean side: https://www.digitalocean.com/docs/networking/ipv6/.

Resolution

As a workaround, the precedence over the getaddrinfo calls can be modified to prioritize IPv4 over IPv6:

  1. Connect to the server via SSH.

  2. Open the /etc/gai.conf file in any text editor, for example, in the vi text editor:

    # vi /etc/gai.conf

For Debian/Ubuntu
  1. Remove the # symbol from the line below:
  • Before:

    CONFIG_TEXT: # precedence ::ffff:0:0/96 100

  • After:

    CONFIG_TEXT: precedence ::ffff:0:0/96 100

  1. Save the changes and close the file.
For RHEL/Centos
  1. Add the line below to the /etc/gai.conf file:

    CONFIG_TEXT: precedence ::ffff:0:0/96 100

  2. Save changes and close the file.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.