Recently I decided to migrate my mail server and I took this as an opportunity to better get my head around setting the whole thing up. I've used iRedmail in the past but the whole process seemed a little like magic so I took a scouring around the internets for a decent tutorial and came across A Hacker's Replacement for Gmail and figured it might be worth building up a salt-stack for people.
There is a few differences between my salt-stack and the linked article.
- Primarily, I didn't need notmuch or any fancy indexing on my server.
- Personally, for security I grab all of my mail on Thunderbird and keep it offline with backups. So my server is pretty thin.
- I completely ignored his exim4 guide and only went with postfix and dovecot for security.
- I needed to add in some more security settings to get postfix up and running nicely.
Anyway the salt-stack is here and there should be very few changes in getting it up and running. Basically change with your server's username and with the domain you wish to email out from. I've only tested it with Debian 7 and Thunderbird as a client but it all worked.
If anyone has any improvements, just let me know.