Personal project to implement a self hosted email within AWS using cdk.
- install cdk tools following existing AWS instructions
- Required parameters: These to be set up on AWS and passed in as context:
smtp_password_arn
- arn to a secrets manager smtp password- further notes about this upcoming. this needs to be set up per AWS instructions
smtp_username_arn
- arn to a secrets manager smtp usernameelastic_ip
- ip that can be assigned to the instancehostname
- domain that is owned that can be assigned to the instance
- Optional parameters: These will be created if not provided. If they are created ahead of time and passed in as context, they will be used. Upon stack delete, the buckets will persist.
backup_s3_bucket
- backup bucket namenextcloud_s3_bucket
- nextcloud bucket name
- Run like:
cdk synth||deploy --context backup_s3_bucket=bucketname --context smtp_password_arn=arn:aws:secretsmanager:etcetc --context smtp_username_arn=arn:aws:secretsmanager:etcetc elastic_ip=123.21.13.132 domain=example.com nextcloud_s3_bucket=bucketname
I'm managing a project plan with github projects
- Redo the entire original install process with cdk
- Set up monitoring and alerting over EC2 & SES
- Get out of SES sandbox
- Once testing is complete, transfer my mail from it's current host to self host
I loosely followed this guide.
- I needed to change and add a few parameters since the cloudformation template notes seemed outdated.
- I don't use AWS R53 with the domain I'm testing with. I needed to go to my hosting provider and set up the mail server config.
- Cloudformation got stuck within the Creating step. However it wasn't fatal. I followed the notes in this github issue to send to cloudformation a success message from the EC2 instance to ensure the install wasn't rolled back.
- There were some interactions between some of the parameters that took a while to get right. Specifically the template works whether you are creating a new install or restoring from backup, but different parameters are needed depending upon the use case.
- From the guide followed the instructions for setting up SSL/domain records, and SES in sandbox mode.
- The status page for mailinabox is fantastic for figuring out configuration issues.
- Currently $10/month to run the EC2 server. Nothing else yet, but I'm also not really using mail capabilities.
- This is not for my gmail accounts. I do have issues with my custom domain emails, and would consider self-hosted-email for those accounts.
- This is mostly for fun. I'm trying to learn more about AWS so why not use it for something real.
- My custom domain email is either not set up, or is in a parked webhost. The webhost has horrible spam protection. I'd love to be able to manage spam myself, because anything would be an improvement.
- requires the black python formatter and will fail in github actions if not properly formatted