Receive email via Amazon Simple Email Service (SES) and synchronise it to a designated IMAP mailbox. Adequate logging, persistence in S3 and Dynamo DB is part of the handler's process.
For anyone who wants to keep their email address anonymous, Loft is a catch-all email receiver based on AWS. Loft moves email sent to any '[alias]@[mydomain].com' to an IMAP mailbox such as Gmail. Unlike email providers who allow for the addition of a '+' in email addresses to create aliases (e.g. johndoe+contoso@example.com), Loft works with any registered alias, for any domain name you register. Thereby solving the problem that email addresses often contain (parts of) a real name. What's more is that with a few dozen emails per day, the solution is practically $0 on your AWS bill too!
This project is named after the construction that houses homing pigeons: a Loft. Each pigeonhole is essentially a separate mailbox.
The following AWS services are used: CloudFormation, SES, SNS, SQS, S3, CloudWatch, Dynamo DB, Lambda, SAR and IAM.
- Domain name with control over MX records in DNS
- Configured Amazon Simple Email Service to receive email on the domain (guide)
- Mailbox that supports IMAP for synchronising email (e.g. Gmail)
- IMAP credentials for the destination mail server (e.g. Gmail app password is recommended to avoid using your main password)
Loft is available in the AWS Serverless Application repository from where you can deploy directly into your AWS account using AWS CloudFormation.
- Click here to deploy directly
- Set the new SES Rule Set as active under Email receiving > Rule Sets
Note: when deploying manually, the default AWS region is Ireland (eu-west-1
). You can change this in samconfig.toml
.
- In the S3 console, empty the Loft email bucket
Warning! This permanently destroys all email in the S3 bucket and Dynamo DB. - Delete the Loft CloudFormation stack from the control panel
Alternatively, you can run the cleanup script: loft$ scripts/6-remove.sh
.
We'd love contributions that help to build a web UI on top of Dynamo DB, providing metrics on incoming mail and used aliases for the domain.
The project source includes function code and supporting resources:
src/
- C# .NET Core Lambda function with the solution file in the repository root underLoft.sln
.doc/
- Architecture diagram from Draw.io.scripts/
- Shell scripts that use the AWS SAM CLI to deploy and manage the application.
To develop on any platform, you'll need the following toolchain: