Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receive email with AWS SES without MX record

Tags:

aws-sdk

I'll like to process incoming email on a specific email. In aws docs it says

Although you are not required to publish an MX record to receive mail through Amazon SES, if you don't publish the record, Amazon SES will receive mail for your domain only if you explicitly route it to Amazon SES.

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-mx-record.html

How do I explicitly route email to SES?

like image 252
Ido Ran Avatar asked Feb 06 '16 20:02

Ido Ran


2 Answers

After hours of research and failed attempts of having SES receive emails without the use of a MX record (had set up an additional Route via gSuite / Google Apps), here is my best suggestion on how to go about this.

Short Version

Create a subdomain and point its MX record to SES after inserting the TXT verification record.
After creating the necessary ruleset to receive and save email from [email protected], you can now have SES receive email from any email address you own (even if it's not verified with SES) by simply forwarding its emails to the SES enabled subdomain email address.


Long Version

Unfortunately, it does still require an MX record, but check it out...

You can create a custom subdomain on your primary domain and call it anything. In my case, I called it ses.mydomain.com Next, I added my newly created subdomain to SES via the Domains link.

Immediately upon adding it as a domain to SES, a pop-up window appears displaying the required TXT verification record and MX mail record.

Shortly after assigning these two DNS records to my subdomain, the subdomain is verified and able to receive email after setting a few quick rules via Rule Sets!

Here's the cool part - you can still have SES receive email from any email address you have access to.

How you might ask?

By just setting up a forwarder on the email address you do want to send to SES, by forwarding it to the SES-enabled subdomain email address.

Meaning - If SES is able to receive email from [email protected], but you want it to actually receive email from [email protected], then all you need to do is forward [email protected] to [email protected]!


Remember, you still need to create the necessary rules to receive emails. See this AWS Blog Post for more information.

like image 77
sudo soul Avatar answered Oct 04 '22 00:10

sudo soul


Use one of the AWS SES's inbound endpoints:

http://docs.aws.amazon.com/ses/latest/DeveloperGuide/regions.html#region-select

e.g. for US-EAST-1 the inbound endpoint is inbound-smtp.us-east-1.amazonaws.com. For receiving only you do not use SMTP endpoints. The procedure is pretty much the same using MX records or not: somewhere (in your DNS or in your mail handling system) you must point to a SES inbound endpoint.

For example, my MX records point to Google Apps, but using 'Hosts' and 'Routing' (inside Google Apps/Gmail options) I managed to relay only one recipient to SES. So every e-mail my domain receives goes to Gmail recipients as usual, except for one [email protected] which I relayed to SES (which, in turn, goes to SNS then to SQS).

like image 30
Renan Avatar answered Oct 04 '22 00:10

Renan