Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 just got started with an EC2 instance and got my mail sending limit removed, allowing me to send emails from my instance. But due to lack of experience, I have no clue on how to enable receiving emails send to me on that server.

The instance has an elastic IP and I have a domain name with an A record pointing to that IP. I cant seem to find better documentation on what steps need to be taken so if someone sends an email to it either actually receives it or simply forwards it to my personal email.

I know that it involves using postfix but cant find a guide to properly configure it after the installation.


share|improve this question
You probably also want an MX record in addition to or instead of the A record. – wfaulk May 4 '12 at 22:03
up vote 7 down vote accepted
  • A record that points to your server.
  • MX record that points to your A record.
  • Mail daemon listening on port 25 -- I tend towards Postfix.
  • Firewall rules allowing port 25 to accept connections. On EC2, you need to set this in your security groups
share|improve this answer

I was facing similar problems. I have an MX record set up and the ports unblocked in the security policies, but a port scan still shows port 25 as blocked.

I came across this answer on the AWS forum. It seems that you have to request to specifically unblock your port 25 / 445. should be useful to test your server.

share|improve this answer

You'll need an SMTP daemon such as postfix installed, and thus, the ports open from the AWS security group for starters.

Then, you can follow a configuration guide - have a look at the postfix basic configuration guide.

In a nutshell, you'll want to be 100% sure you're not operating as an open rely. Here's a very basic for simple username based delivery that I use:

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no

myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

mydestination =,, localhost
relayhost =
mynetworks =
#mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

smtpd_helo_restrictions =
share|improve this answer

It's also worth noting that sending email directly from ec2 instances will likely result in them being marked as spam.

Use the SES service from amazon to get around this - but also note that there are known bugs in that system.. such as mac osx default mime type for jpeg images being blocked.

If you're able to have mail somewhere else, I would do that as it can become a pain to implement workarounds for stupid SES "features".

share|improve this answer

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.