Redirecting EMails with Amazon SES Service

20,235

Solution 1

SES is not able to redirect messages by itself, but can call Lambda function and it can redirect message.

There is ready to use Lambda function: https://github.com/arithmetric/aws-lambda-ses-forwarder

Solution 2

I had this problem recently (July 2019), and googling it brought me here. The answer was not so obvious to me, so here is how I configured my domain on Route 53 to both receive and send email with my email account at gmail:

Receive email: Use improvMX to forward all emails directed at *@yourdomain.com to your personal mail. I have found this by looking at this answer. You only change your MX records on Route 53 and setup a free account on improvMX. improvMX will then forward all the email directed at your domain to your personal email. You can also select specific mail addresses for forwarding like [email protected]. This is way easier than you think. It took me literally 5 minutes.

Send email: Amazon SES service is basically a SMTP server for sending mails. So if your domain is on Route 53, then using Amazon SES is really easy. Here is the Amazon SES doc for sending mail using SMTP. Basic steps for connecting SES with gmail:

  1. Create an IAM user as explained in the AWS doc, which will give you a username and a password.
  2. In your gmail account add another email address to send as.
  3. Uncheck "Treat as an alias". (When checked, gmail will try to receive emails from SES, which won't work.)
  4. Use SES's SMTP server address for SMTP server, and IAM credentials obtained previously for username and password.
  5. You're done! Now you can send emails using [email protected] from gmail.

Additional note here: In order to send mail using SES you need to get your SES account out of sandbox.

I know the question only asked for receiving emails, but I figured someone might be looking to do both receiving and sending, like me, so I hope this answer helps someone.

Solution 3

This email redirection is the "missing feature" of the AWS platform, but there is a "free" workaround that will provide the redirection for you. Create an account with mailgun (free for under 10 000 emails a month) and when you set up your domain, you can redirect it to the mailgun servers (which is very clearly explained in their documentation). You can then use a combination of what they call "routes" to setup any combination of redirects based on:

  1. Email name being sent to [email protected] or [email protected]
  2. Subject of the email
  3. Various properties of the email header

I was fully ready to give up on having email accounts under my Route 53 domain, but this worked perfectly for me.

Solution 4

AWS have documented how to do this using a lambda written in Python

https://aws.amazon.com/blogs/messaging-and-targeting/forward-incoming-email-to-an-external-destination/

Share:
20,235
David Graf
Author by

David Graf

Updated on October 01, 2021

Comments

  • David Graf
    David Graf almost 3 years

    I am searching a way to redirect email which are sent to a domain whose DNS is Amazon's Route 53 service. E.g. I would like to redirect the email [email protected] to [email protected]. And [email protected] to [email protected]. Is this possible to do with Amazon's Simple EMail Services (SES)? Is there another way to do with with AWS services (except setting up an email server on EC2)?