Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Email server on EC2 with an elastic load balancer

Let's say I have a couple of ec2 instances with an elastic load balancer, and I want to run an email server on them so I can send and receive emails from multiple addresses. What is the best practice to do that?

like image 733
Iddo Gino Avatar asked Dec 09 '12 07:12

Iddo Gino


People also ask

Can I send email from EC2?

It is possible to send emails from an EC2 instance. You must fill in an online form with Amazon to remove the sending restrictions and set up the reverse DNS.

Which load balancers support EC2 elastic?

Elastic Load Balancing supports the following types of load balancers: Application Load Balancers, Network Load Balancers, and Classic Load Balancers. Amazon ECS services can use these types of load balancer. Application Load Balancers are used to route HTTP/HTTPS (or Layer 7) traffic.

Can I host a mail server on AWS?

To use this feature: Log into the AWS Management Console. In the SES tab, select SMTP Settings and click on Create a New SMTP User. Use the default User Name or edit this name and click Create.

What service works with elastic Load Balancing?

Elastic Load Balancing (ELB) is a load-balancing service for Amazon Web Services (AWS) deployments. ELB automatically distributes incoming application traffic and scales resources to meet traffic demands. ELB helps an IT team adjust capacity according to incoming application and network traffic.


1 Answers

It's sort of a broad question, but I can give you a (hopefully) helpful, specific answer. Email is a topic that doesn't get talked about much with AWS. In fact, this is where the benefits of the cloud can get a little... cloudy.

In my view, the key issue is email deliverability -- making sure that the emails sent from the cloud are reliably received by the intended recipients. Because of anti-spam measures employed by email providers, that means using IP addresses that have a good reputation. Unfortunately, that's not a big benefit of AWS. In fact, many spam filters simply drop emails sent from AWS IP's, and this is true for other cloud service providers as well.

So whenever I send any email from AWS, I always use a forwarding service such as SendGrid. Such companies offer SMTP forwarding in a secure way, and give you all the tools you need to reliably deliver both bulk and transactional emails.

At entry level, you use shared IP's and get the benefit of DKIM, open- and click-tracking, and bounce/block reporting. SendGrid helps to take care of managing your domain's reputation with the big providers. At higher service levels, they can help you warm up and maintain your own dedicated email-sending IP address to ensure that you are not impacted negatively by other SendGrid customers.

Of course, Amazon also sells Simple Email Service, and there are also other options such as sending through Gmail. I am in no way affiliated with any of these companies, but my main piece of advice to people wanting to send any kind of email from a cloud provider is to always use a third party service to maximise deliverability.

As to receiving emails, an Elastic Load Balancer isn't helpful for SMTP, though if you are providing webmail then it can help balance your port 80 traffic. For SMTP, use multiple MX records with the same weight, pointing to a set of hosts that can receive the email.

For your Mail Transport Agent, I recommend Postfix, but that's a matter of preference. You will find many people also recommending Qmail and Sendmail.

like image 95
platforms Avatar answered Sep 22 '22 14:09

platforms