Codegyre / DockerPostfixDovecot

Simple email server executed in Docker container
25 stars 21 forks source link

Dovecot + Postfix email servers inside Docker

This docker container is aimed to run Postfix and Docker as email server. Inside your application you can receive and manage emails using Dovecot server.

To create email addresses you need MySQL database with tables; add email domains into mail_virtual_domains, add email users to mail_virtual_users.

Pull From DockerHub

docker pull davert/mailserver

Build Container

docker build -t mailserver .  

It is recommended to add environment vars (see below) into your Dockerfile to inject them on build.

Run Container

Container requires access to mysql socket and directory to store emails. It also exposes email ports

docker run -i -t -e APP_HOST=example.com -e DB_NAME=dbname -p 25:25 -p 110:110 -p 143:143 -p 995:995 -p 587:587 -v /var/run/mysqld/:/var/run/mysqld -v /home/vmail:/home/vmail/ mailserver

Environment Vars

Directories