Receive email by Amazon SES and store in Amazon S3 bucket

Amazon SES → Amazon S3 → AWS Lambda

This sample project demonstrates how to receive email using Amazon SES and store in Amazon S3 bucket which triggers AWS Lambda to process the email.

User sends email to the configured domain in Amazon SES.
Amazon SES receives the email and then applies the rule set to store the email in a Amazon S3 bucket.
The Amazon S3 bucket object creation event triggers an AWS Lambda function.
The AWS Lambda processes the email from the Amazon S3 bucket.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/ses-s3-lambda-sam

Deploy

sam deploy -g


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Disable the Amazon SES rule set using the following CLI command: aws ses set-active-receipt-rule-set --region {your-region}
Delete the Amazon S3 email bucket content: aws s3 rm s3://{EmailBucketName} --recursive --region {my-region}
Delete the resources deployed to your AWS account via AWS SAM: sam delete

Created by:

Biswanath Mukherjee

Biswanath Mukherjee

Sr. Solutions Architect working at AWS India.

Follow on LinkedIn