I'm not sure what to do about this. When on a different IP (the same server set up, domain etc), we had no problems with email deliverability. Since transferring to EC2, despite having the AWS imposed SMTP limits removed, I'm finding that my server's email goes into my spambox. My site sends several hundred (legitimate, opt-in) emails a day. What do you think is the best solution here?
Chris.
Amazon has now released their own email service. Amazon SES. Thats your best bet for just sending mail. http://aws.amazon.com/ses/
If you want more detailed statistics and insight into your mail like tracking opens and clicks you could use a third party SMTP server, the old favourite is AuthSMTP, if you want something a little more modern and cheaper try Elastic Email (http://elasticemail.com).
EC2 now lets you do configurable reverse DNS, which is a big help if you're trying to send out email from an EC2 instance. Have a look at this AWS blog post for more details.
Generally EC2 IPs are banned and blacklisted almost in all spam filtering service due to an unfortunate thing that spammers like to buy instances and use it for spamming.
The only thing that you could do about it is to use elastic IP and ask the common spam filtering services to remove your /32s.
Other solution would be to use some SMTP proxy service somewhere.
This is what worked for me after some trial and error with the EC2 instances
/sbin/postfix
instead of/sbin/sendmail
I set my mailserver's hostname in /etc/postfix/main.cf like this:
myhostname=www.your.tld
(change www.your.tld to your server's name)I set a Sender Policy Framework (SPF) record up in my DNS like this:
@ IN TXT "v=spf1 a +all"
I set a DKIM record up in my DNS like this:
_adsp._domainkey.your.tld IN TXT "dkim=unknown"
(Change your.tld to your domain name eg. example.com)I requested reverse-DNS be setup on my Elastic IPs to resolve to my domain using the AWS contact form at
https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request
My web application's mails don't get routed to spam by GMail anymore. Not until they dream up some new anti-EC2 -err anti-spam cock and bull anyway!
In my opinion its a bad idea to have a +all in SPF record. +all means pass all, as good as not having an SPF record. You should change it to something like
where
+a means allow all ips which have an A record in the DNS
+mx means allow all ips with an MX record in the DNS
ip4:n.n.n.n means allow this IP to send emails
-all means do not allow anything else to send emails from this domain. The rules are checked from left to right. hence -all in the end will disallow anything that did not satisfy the earlier rules
Also
should be changed to
Hmmm in my case using postfix and forward emails via authsmtp or sendgrid.
http://pauldowman.com/2008/02/17/smtp-mail-from-ec2-web-server-setup/ http://wiki.sendgrid.com/doku.php?id=postfix
Take this Email Server Test. It will give you possible suggestions to implement. If you are unable to implement the suggestions (or) still have issues, you can get an SMTP Relay Service
If you fill out this form and include your Elastic IP addresses, your IP addresses will not be listed on the blacklists (after a couple of days) unless you actually start spamming from them.
https://aws-portal.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request
By default, EC2 IP addresses are greylisted on most spam lists due to their dynamic nature. Submitting the request above will make it so your IP addresses aren't grey listed.
It's a bit dangerous to use EC2 to send emails. EC2, by its nature, allows you to rapidly spin up and take down machines, which makes it great for sending spam. I would recommend you send your emails out of a fixed SMTP host dedicated to your company. I've actually done this myself: Our new startup runs on EC2, but sends emails using Google Business Email services on IMAP.
Simon @ LabSlice