I like to run my own mail server. The problem is, when I started, there were no containers around, Ubuntu was known as Maverick and I could only pay a little root server. So how to keep a never-change-a-running-system system up-to-date?
Meanwhile ansible and docker came around the corner - so they should fit a low-cost-I-have-to-do-it-once-in-a-few-years approach.
- Provide a simple docker container with all the mail tools I need and easy provisioning.
- Have an easy way to add or change domains, addresses and aliases.
- check spf records.
Build docker container
sudo docker build -t postamt .
sudo docker run --name postamt-persist -d -v /srv/postamt/data ubuntu:14.04 true
Run docker container
sudo docker run --name postamt \ -p=25:25 \ -p=143:143 \ --volumes-from postamt-persist \ postamt
Create virtual mail user
# see postamt admin help sudo docker exec -it postamt postamt --help # this will create a virtual domain, an email address and a user with password access sudo docker exec -it postamt postamt user add firstname.lastname@example.org -p foobar
Inside the postamt container
All variable data is located in
data |-- helo_checks |-- mail.sqlite |-- ssl | |-- dovecot.crt | |-- dovecot.key | |-- postfix.crt | `-- postfix.key `-- vmail
At the moment debugging is turned on, as long as I need it.