Forwarding Emails to your Inbox Using Amazon SES

Amazon Simple Email Service (Amazon SES) is a cloud-based email sending service designed to help digital marketers and application developers send marketing, notification, and transactional emails.

It also provides capabilities to receive emails and programmatically process them or store them for archival. On of the major challenge with SES is to forward the emails to a users inbox since it doesn’t support IMAP/POP3 protocols to access email.

Image for post
Image for post
Forwarding setup overview

I have automated most of the steps using AWS CloudFormation, available in SESEmailForward Github repository.

Click the Launch Stack Button to provision the AWS CloudFormation Stack.

Image for post
Image for post

AWS CloudFormation Stack, provisions the following set of AWS Services and Code.

  • SNS Topic to forward, received emails from SES
  • IAM Role to invoke Lambda function from SNS
  • Lambda function with NodeJS code to forward the emails to a defined from and to address
  • IAM Role allowing Lambda to forward emails.

Note: When an email is forwarded, it uses the from address parameter, given to the CloudFormation Stack as the sender’s email address as the from address. This address is seen as the from address for the email forwarded to your inbox. However, since the reply-to header attribute is set to the original sender, it allows replying to the original sender, directly from your inbox.

Since AWS SES doesn’t support CloudFormation at the moment, you need to create an email receiving rule from Amazon Web Console SES section and forward the email to the provisioned SNS topic.

Note: This article expects as a prerequisite, you have successfully validated your email domain in AWS SES.

Steps to Setup Email Receiving Rule

  1. Go to SES Service in AWS Web Console and Click “Rule Sets” under Email Receiving.
Image for post
Image for post

2. Create a Rule Set and view the Rule by clicking on its link. Also create a Rule specifying the email address you are expecting for the emails to be retrieved using Add Recipient (You can also use wildcard to receive all the emails to this Rule)

e.g All the emails sent to will be received to this rule.

3. Go to Next Step and in the Actions section create an Action for SNS and select the provisioned SNS topic (Using CloudFormation) from the list, go to Next and Create the Rule.

Image for post
Image for post

4. After creating the rule, go back to the SES Home and make the RuleSet as the default rule set by selecting it and pressing the button “Set as Active Rule Set”

Image for post
Image for post

Written by

I’m currently working as a Software Architect at 99X. For more details find me in Linkedin

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store