On my VPS (a tophost.it "TopServer" with Ubuntu 12.04 LTS), since a few days ago all my apps are became unable to send emails. All I could learn from the logs is that every request goes timeout.
I then tried to simply call from terminal
telnet smtp.gmail.com 587 and I noticed the following anomaly: while on every other well-working server the answer takes only few ms to process and is simply
Trying 188.8.131.52... Connected to gmail-smtp-msa.l.google.com.
On the VPS in question the answer is instead
..and only after approximately one minute (during which the apps are going to timeout I guess)...it finally says:
Trying 184.108.40.206... Connected to smtp.gmail.com.
So what's going on here? Why it tries with an IPv6 before and, only after several seconds, with the correct IPv4? How can I fix this behavior to avoid the timeout errors?