Getting e-mails for your AWS managed domain, finally!
If you are using Route53 to manage you custom domains, the procedure to get to receiving emails on *@yourdomain.com is pretty straight-forward.
Before we dive into details, some basics to digest:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-concepts.html
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-consider-use-case.html
Constraints:
If you store emails in an Amazon S3 bucket, the maximum email size (including headers) is 30 MB. If you receive your emails through Amazon SNS notifications, the maximum email size (including headers) is 150 KB.
Get going in the AWS Console
So in my case, I want e-mails for my domain platformeconomies.com.
Following https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-getting-started.html, I would first set up some records sets:
Since the registrar is AWS in my case, the domain verification is pretty much fully managed on my behalf.
So called “rule sets” allow you to set up all you need to start receiving e-mails. Using these rule sets, you would specify e.g. where the e-mail contents would be stored, or rather in which S3 bucket.
An incoming object can be associated with different actions, as part of the (receipt) rule you create. You could fire a Lambda function if you want to.
The E-Mail Receiving Rule Set is as well the easiest way to enable/disable receiving mails. Unflag one option (“Enabled”) and the email reception ends.
If you disable the rule set, this could be the kind of bounce you would get as sender:
Last but not least, what’s the cost for receiving and sending mails? Well:
SENDING & RECEIVING METHODS
Speaking of sending e-mails. (So far we only covered receiving.)
The good old SMTP access comes to mind, and yes you can have it in AWS:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/get-smtp-credentials.html
^ Quite some process to get to your SMTP details, though!
The easier way to send an email using SNS and your custom domain however is probably the CLI:
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-formatted.html
Check this out, sending mails via Lambda and SES:
ERGO
It’s not exactly super-intuitive and AWS could offer a tad more to help you with some basic e-mail receiving, sending capabilities for the domains you registered with AWS.
It’s certainly doable, however. And if you think about it, you get a lot of power and flexibility by using SNS and Lambdas, potentially. In fact, you could perform whatever complex workflow you desire. Cost effective, too.
That is, if you care about that.
Speaking of cost, put aside the costs already mentioned you should consider to lifecycle manage your S3 bucket used for your mails. Data could pile up there quickly. And data piling up in the cloud always translates to cost.
(Read up on lifecycle policies for AWS here.)
Enjoy!