How do I find out why Gmail is seemingly refusing connections from my specific IP range?
I'm getting a "Connection timeout" error when attempting to send email through smtp.gmail.com using the email facilities in Django running on a Linux machine on Amazon's EC2 service.
Oddly, I can send mail using sendmail, but it initially gets the same timeout error and then falls back to an alternative server, which accepts a connection, e.g.
~$ echo -e "Subject:test subject\ntest body\n" | sendmail -v myuser@mydomain
Loading lookup modules from /usr/lib/exim/4.72-1.fc13/lookups
Loaded 0 lookup modules
LOG: MAIN
<= app@domain U=app P=local S=443
Loading lookup modules from
/usr/lib/exim/4.72-1.fc13/lookups
Loaded 0 lookup modules
delivering 1ReChV-0001Hx-Ss
Connecting to aspmx.l.google.com [74.125.93.26]:25 ... failed:
Connection timed out (timeout=5m)
LOG: MAIN
aspmx.l.google.com [74.125.93.26] Connection timed out
Connecting to ALT1.aspmx.l.google.com [173.194.66.26]:25 ... connected
This is only occurring from Amazon's cloud. I can connect to smtp.gmail.com from my localhost using the same credentials, and send email just fine. And I can ping smtp.gmail.com just fine from everywhere, so it doesn't seem to be a routing or firewall issue.
Google lists no problems on their status dashboard.
The server in question sends very low volumes of email (10-20 a day), so I'd be surprised if it was flagged for spamming.