0

We have a Django webapp running on an Amazon EC2 instance. We're using the Django django.core.mail.send_mail() function to send emails out. This doesn't work for Gmail accounts, but it is working for other accounts -- in particular, my college account, which is run through Gmail, receives the message with no problems. Checking /var/log/syslog shows this:

Jun 22 19:50:43 apatapa postfix/smtp[7625]: 4D80524B4F: to=<NAME@gmail.com>, relay=none, delay=120, delays=0.02/0.01/120/0, dsn=4.4.1, status=deferred (connect to alt3.gmail-smtp-in.l.google.com[173.194.70.26]:25: Connection timed out)

Sending to a college account:

Jun 22 19:54:49 apatapa postfix/smtp[7658]: 0570A24B57: to=<NAME@COLLEGE.edu>, relay=COLLEGE.edu.s10a1.psmtp.com[74.125.244.10]:25, delay=2.4, delays=0.02/0.01/0.36/2, dsn=2.0.0, status=sent (250 Thanks)

Just to be sure, I used traceroute, and an email sent to the college account is actually going through Gmail's servers.

Any ideas on what might cause this?

Peter
  • 1,349
  • 11
  • 21

2 Answers2

0

Do you have an A entry from your domain to that EC2 node? Do you have a reverse DNS entry to that domain? How do you make sure email you send programmatically is not automatically marked as spam?

Community
  • 1
  • 1
hsanders
  • 1,913
  • 12
  • 22
0

Check the access rules for the security group this server is assigned to. The "timed out" message looks like a real network timeout, not a deferral, and Gmail doesn't do "grey" listing. Another thing that looks suspicious is that your college email mx record actually points to Postini, not Gmail. Google owns Postini and they offer it for hosted accounts, but it has its own mx servers and doesn't use Gmail's mx. That means the mail would eventually reach Gmail's servers but through Postini's mx servers.

jadams
  • 1
  • 1