My VPS provider (DigitalOcean) blocked SMTP on IPv6 by default :(
I had to disable IPv6 on server with next config:
# /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Apply settings:
$ sysctl -p
Uncomment the next line in /etc/gai.conf
to prefer IPv4:
precedence ::ffff:0:0/96 100
And remove IPv6 DNS from /etc/resolv.conf
:
nameserver 2001:4860:4860::8844 # remove lines like this
nameserver 8.8.8.8 #don't remove
Then restart application and Nginx (optional)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…