Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

My IP has been unblocked with Amazon and reverse DNS is in place. When I send out email via postfix through my EC2 server sometimes the emails are marked as spam and sometimes not. What could be causing this random behavior of email being marked as spam?

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

I use EC2, and after some initial troubles have had reasonable success with emails. If you are not going to use an external service, a few suggestions:

  1. Use an Elastic IP (and don't change it frequently) - I think this is the biggest one - a constantly changing IP does not lead to any confidence in the sender
  2. Check some of the common email blacklists - most have a manual 'delist' option. If the IP you are using is listed, ask them to remove it (or get another Elastic IP that isn't listed).
  3. Configure your DNS properly - including MX records, and an SPF record
  4. Sign your email using DKIM/DomainKeys (I suggest DKIMproxy)

The reverse DNS is important - but EC2 IPs do point to a DNS entry that maps back to the IP, so even though it may not point to your domain, it doesn't seem to count against one.

share|improve this answer
    
For the SPF record what is the correct syntax for Amazon? –  john Jul 15 '11 at 3:41
1  
SPF is unrelated to Amazon in this case (i.e. it could be the same for a non-AWS server). I usually use: v=spf1 a mx -all (essentially, saying only emails originating from addresses matching my A or MX records are valid, all others are not). You can, of course, define considerably more varied records. Take a look at OpenSPF for details or give the Microsoft SPF Wizard a try. –  cyberx86 Jul 15 '11 at 4:36
add comment

All of the EC2 address space has a poor reputation for sending email, simply because with ephemeral IP assignment, there's no way to tell the legitimate user using an IP address one minute from the spammer using it the next.

If you'd like reliable delivery, I'd suggest finding some other way of sending mail. Amazon themselves offer Simple Email Service, and there are quite a few SMTP relay services around which can be easily integrated with a mail server running on EC2.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.