Is it possible to use an Amazon EC2 instance as an email server?

undefined picture undefined · Dec 9, 2009 · Viewed 20.7k times · Source

I want to be able to run an EC2 instance (CentOS LAMP based) as a mail server and create email addresses for users when they sign up so that they can upload files via email. The emails would be parsed and attached files processed and added to S3 for storage.

Is this feasible?

What mail package would I need for this? I would like to be able to create email address such as [email protected]

my domainname points to a webserver not on amazon web services so I realise this may not be possible.

where do I start with this, are there any good resources for setting up a mail server on EC2

many thanks

Answer

itchi picture itchi · Dec 25, 2009

To answer the question, yes it is possible. As paul says, if you require 24x7 and long term then EC2 may be more expensive than some other providers. But it can make sense if you're a startup or if you're doing this to learn more about these topics.

Basic steps would be:

  1. Create a linux EC2 Instance http://docs.amazonwebservices.com/AWSEC2/2008-02-01/GettingStartedGuide/?ref=get-started
  2. Install a mail package http://flurdy.com/docs/postfix/
  3. Change your DNS MX record http://en.wikipedia.org/wiki/MX_record

Amazon has had trouble in the past with blacklisting.. but they're trying to address that. Read here: http://developer.amazonwebservices.com/connect/thread.jspa?threadID=37650

Edit: You could also use a pre-configured CentOS image (combining step 1+2), this one has postfix already installed: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=821