Setting up Email Accounts EC2 - email

I am just getting started with AWS and EC2 and can't quite get my head wrapped around what to do with email.
On previous servers, I would use it as a mail server and on cPanel create all the email accounts I needed, and could access them through web mail.
I can't get a consistent answer on how to set up email accounts on a domain that is pointing to an EC2 instance.
My question is, how can you set up email accounts for a domain pointed at EC2 instance, and if its not possible is there a way to set up emails on a third party like gmail with the domain pointed at EC2?
Just so you know the domain is managed at GoDaddy.
Thanks

I suspect if you are trying to treat it like shared hosting, EC2 may end up being more work than its worth. If you do want to give it a shot, read on.
EC2 provides mostly barebones virtual machines that you can purpose for anything you may need. They don't come with hosting control panels as many people use instances for things other than hosting websites.
You should be able to install cpanel or directadmin, but you may have some difficulties getting it to licence correctly as licences are often tied to a public IP (In EC2 everything is NAT'd).
To set up email on your instance, you need to install some kind of email server. There are quite a few different options available depending on what host operating system you choose to use. There are alot of tutorials that can walk you through setting up a mail server.
Now, for the annoying part. All EC2 IPs are on Spamhaus blacklists. To get around this, you can you can either configure your email server to forward through Amazon SES or fill out this form to whitelist your server IP: https://portal.aws.amazon.com/gp/aws/html-forms-controller/contactus/ec2-email-limit-rdns-request
Running your own email servers on ec2 is doable, but if it is my call, i'll go with something like Google Apps for Domains to handle my email accounts.

Related

How to send/receive email using Sendinblue with a Google Domain which has a domain pointing to Google Cloud DNS zone (where k8s hosts the website)

I am using Google Cloud for running a website, accessible on mydomain.com (fake, for illustration). I am trying to figure out how to receive email at support#mydomain.com (and let it be accessible by a human like a normal email) and also be able to send custom emails from info#mydomain.com programmatically. I am not sure what technology I am missing to be able to do this.
I have a k8s cluster with an Ingress with a static IP exposed through Cloud DNS zone. The NS records for mydomain.com. match the NS records on Google Domains. This works and I can access my website as expected.
From a little bit of research, I think I need to use something like Sendinblue because using their service will likely make my emails more legitimate. I purchased a dedicated IP in Sendinblue. Following this guide, I added ns1.sendinblue.com and ns2.sendinblue.com NS records for mail.mydomain.com in my Cloud DNS zone. I have associated the domain in Sendinblue and picked matching NS records. Then I created a sender and I am trying to verify this sender, but I have no inbox. This is the most confusing part. So I found this question-answer and followed by adding MX records and setting up email forwarding to mydomain+support#gmail.com (a plain Gmail account).
So now I expect any emails sent to support#mydomain.com to be accessible from the plain Gmail account. When I send emails, I do not receive them but I also do not get back a delivery failure. I've waited 12+ hours to make there isn't a DNS delay.
I feel like I haven't wired up these pieces correctly together and I am missing something but I am not sure what.
This is the answer publish by John Hanley added as community wiki since #John Hanley did not add as answer:
"
Select a normal mail service (Google Workplace, Office 365, Zoho (which offers a free account) and set up mail on your primary domain. Use Sendinblue as your email marketing tool - as it is not a general purchase email system
"

How to create an email account and set up email receiver when using AWS EC2 and SES?

So we are planning to use AWS SES for sending emails. But how do we set up the email receivers? And how do we create an email accounts? When activating AWS SES, it asks to verify an email account (eg. help#example.org)...
I tried to create a mail server on one of the instances using postfix following this article: http://flurdy.com/docs/postfix/, but it's not easy at all... Does anybody know any better alternatives?
Thanks.
SES is for sending email only. As you note, you must have some other way set up to receive email at least at the "From" address you intend to use, because Amazon will verify it before letting you send.
While you certainly could set up an email server and domain on an EC2 instance, it's very complicated. I recommend that you get an email service for just that purpose. If you only need a single address for all your messages, just get a free address from Google, Microsoft, Yahoo, etc.
If you need multiple addresses, consider getting Google Apps for Business, either for an existing or new domain name (it's easiest to set up if you have it register a new domain name for you). It's no longer free, but it's still quite cheap. A single user account can receive emails for every address in the domain, it's flexible, and it's reliable. It's a good companion to using SES for sending automated emails.
Use Amazon WorkMail if you prefer AWS. Gmail for work, Office 365, Hostgator, are some other examples. FYI, none of these providers simply provide domain emails. They come bundled with many other things such as chat clients, calenders, etc. Pricing of these services depends on what other things they are bundled with.
$4/user/month for AWS
$5/user/month for Google
$5/user/month for Microsoft
Since you are in AWS cloud, I will tell you a few things about Amazon WorkMail.
You get your own domain and 50GB of storage per user.
You get calendars for free.
You cannot use just any desktop mail client. You have to either use Outlook, or Mac's mail client, or the web interface. This is their weakest point. However, including other IMAP clients is in their roadmap (I guess atleast a year).
Integrates nicely with SES.
Important links:
FAQ page.
Features page.
There are many more features such as remotely removing emails from a device, managing your users, and so on.
What I can recommend you is to use Amazon WorkMail because they almost provide all the features supported by others, and you are tied with AWS anyway. AWS also recently launched Workspace and Workdocs (both separately billed) that will allow you to create a complete work solution. These services also combine nicely with IAM.

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?
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.
I agree with most of #platforms' answer in regards to receiving email in the "cloud", i.e., AWS. Especially the note about balancing port 80 traffic and the inability to balance SMTP (using multiple MX records instead). Just to give a different view on this matter, I had always set up a single MS Exchange Edge Transport Server for those tasks. In a Microsoft TechNet post they mention that a farm of 6 of these servers is able to safely handle around 13 million messages a day (even under peak load).
On the sending email from the "cloud", i.e. AWS, matter, I must disagree, though. I highly recommend using Amazon Simple Email Service (SES). It is fully integrated with the rest of your infrastructure, and the AWS SDKs have all the bindings you need for the majority of programming languages/platforms. As long as you correctly set up your Domain Records, DKIM, etc, you will have no trouble with deliverability. You also have the same reports about bounces, blocks, complaints, etc. Source: I have been using SES for years with no single complaint in regards to deliverability.

Can I use my web server as mail server?

I have a dedicated Linux web server where my website is running like www.example.com.
Now I want to start another service for my users and want to give mailing features like Gmail and Yahoo mail.
I want to give facility to my users to create email IDs as they create on Gmail or Yahoo Mail and use it as their email address like XYZ#example.com or ABC#example.com.
Is this possible for me to use my dedicated web server as mail server too,
or I need to hire a new specific mail server for this purpose.
Also, if I can use my server as mail server and can give IMAP and POP like features then what are the PROs and CONs in that?
My hosting company says that I have facility to create unlimited email addresses
and I have created a few for mt like support#example.com and feedback#example.com
and I am getting emails on these IDs.
Is that mean, my hosting already have setup a mail server for me (the same I mentioned in my question and want to setup)
Or this is just for me to use and manage my website and I can not share these email addresses with my users by giving an email service.
Yes you can run simultaneously a web and mail server. Follow part 3 of this guide: http://mysql-apache-php.com/ to set up email. Just make sure that your router is fully capable (supports NAT etc.) - it should be able anyway
However it does appear from your question that your hosting company has set up its own mail server. Which does mean unlimited emails, however the only issue could be the amount of space they are willing to host for you (As in you can only have 2 GB of space on their mail server). Hope this helps.

Sending email using Amazon Web Services

I'm thinking of setting up a simple web application that sends the user a confirmation email when they first register. If I build this on the Amazon Web Service infrastructure, how can I send email from another instance? I would probably have one instance that is just for the application and another instance for the email server.
My question is how does the first instance (the app server) know the IP address of the second instance (the email server)? It is my understanding that the instances can run on any number of servers and can be brought up and down. How does that allow one instance to connect to another instance?
After asking your question, Amazon has since launched Amazon Simple Email Service for this and you would not need a separate instance for an email server. It is available as a web service that you can call to send email. They also have SDK's to wrap the web services in .NET, Java, and PHP.
I'm not sure why you'd want to only send the e-mail from a single instance, since there's nothing special about sending e-mail. That being said, I'd look at a simpler coupling model like Amazon's Simple Queue Service.
Don't attempt to send email directly from an EC2 instance; it will not work reliably as the EC2 IP ranges have been blacklisted by various providers. You'll need to use a thirty-party service such as Google Apps.