Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am not used to cloud hosting. Previously I would just setup an email account through cPanel, but since this is not available how would I go about doing this on a Amazon EC2 account? I am assuming I need a email server running? I installed 'postfix' on my linux instance. Now what?

share|improve this question
up vote 5 down vote accepted

Depending upon your requirements, you either

A) Use SNS


B) don't send email.

Sure, internal email will work fine, but just about everything you send should get rejected as spam unless you send from To set up email you need matching reverse-IP mappings, not to mention SPF and DKIM. With EC2 you don't have access to the authoritative DNS sources for the IPs and therefore can't properly configure the network.

SNS isn't intended for sending mail to end users, but if you're after monitoring or workflow configuration, it'll fit your bill quite nicely.

Likely you'll want an external mailhost. I hear Rackspace has some nice options, but I've never used them myself.


I was unaware of the Amazon mail requests form: this provides another option that will let you send mail from EC2.

You'll first have to allocate and assign an Elastic IP to your mail server, since this removes the fluidity problem. Be sure to set up monitoring, since if your mail server goes down your Elastic IP will be left dangling and you have to pay per hour for unattached Elastic IPs.

Next, you'll need to set up a forward mapping to this IP from your domain: in BIND syntax for the zonefile "", that'd be

mail   IN  A

Depending upon your DNS settings (specifically, your RTTL) this may take some time to propagate. It's easiest just to wait a day, but you'll probably be safe whenever a nslookup returns

You should also specify that mail to your server should be handled by, since the old public IP your EC2 instance had will be replaced by the new elastic IP.

Include the EIP in the form where requested, and as the reverse DNS.

(In BIND, the record would be entered as IN PTR

As the form states, it may take some time for whitelists to be updated.


EC2 hosts are not intended to be terribly stable. If you use this as a production service you should have two mail server hosts configured fully redundantly. If/when one fails, you should have the ability to automatically or at least quickly deploy a new server to replace it.

share|improve this answer
The emails are working but are indeed appearing in spam boxes. I heard you can change the "reverse DNS" settings to fix this problem? – John Jun 28 '11 at 18:27
If you could change the reverse mappings, yes, this would help to solve your problem. But Amazon doesn't give access to these zone files to you because the IPs are much more fluid in a cloud environment. If you want this feature, you need a VPS or hosted mail server. – Michael Lowman Jun 28 '11 at 18:29
In this link:‌​limit-rdns-request what would I enter in the revere DNS fields? Thanks for your help! – John Jun 28 '11 at 18:34
Heh, didn't know they provided that option :) Editing my answer accordingly. – Michael Lowman Jun 28 '11 at 18:36
SNS / SES ? Don't mix up these . – Raptor May 27 at 3:14

These days, you may also be interested in:

Amazon Simple Email Service (Amazon SES)

If you are an Amazon EC2 user, you can get started with Amazon SES for free. You can send 2,000 messages for free each day when you call Amazon SES from an Amazon EC2 instance directly or through AWS Elastic Beanstalk. Many applications are able to operate entirely within this free tier limit.

share|improve this answer
This plus DKIM should be the correct answer. – Dan Esparza Aug 28 '15 at 18:31

Your Answer


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.