A complete mailserver in a single Docker container (Dovecot, Postfix, Postfixadmin, SQLite based)
1.5K
Mailship is a single Docker container e-mail solution. Mailship can be used as simple standalone server or just as a solution for pulling e-mails to the big webmail providers. Configuration is done by postfixadmin, a simple web UI to configure domains and mailboxes. The data is stored in sqlite and for the mail serving postfix and dovecot are used.
Use this docker compose file as an example how to set up mailship in your environment.
version: "3"
services:
mailship:
build: .
image: behringer24/mailship
environment:
POSTFIXADMIN_SETUP_PASSWORD:
volumes:
- mail_dir:/var/vmail
- spool_mail:/var/spool/mail
- spool_postfix:/var/spool/postfix
- sqlite:/etc/postfix/sqlite
ports:
- "80:80"
- "25:25"
- "143:143"
- "465:465"
- "587:587"
- "993:993"
- "4190:4190"
- "11334:11334"
restart: always
container_name: mailship
volumes:
mail_dir:
spool_mail:
spool_postfix:
sqlite:
If you want to run the port 80 behind a reverse proxy, then expose port 80 instead of the configuration
[...]
expose:
- 80
ports:
- "25:25"
- "143:143"
- "465:465"
- "587:587"
- "993:993"
- "4190:4190"
- "11334:11334"
[...]
The volumes are importand to persist the emails and configuration.
When the server is running the container go to your /setup.php (port 80 of the container) and set a setup password. Postfixadmin tells you to put the generated hash into the config.php file. Please copy that hash into your docker-compose.yml behind POSTFIXADMIN_SETUP_PASSWORD:
[...]
services:
mailship:
build: .
image: behringer24/mailship
environment:
POSTFIXADMIN_SETUP_PASSWORD: <yourhashhere>
volumes:
- mail_dir:/var/vmail
- spool_mail:/var/spool/mail
- spool_postfix:/var/spool/postfix
- sqlite:/etc/postfix/sqlite
[...]
Now go to your /setup.php again and set up an admin account. after that you can go to /login.php and start configuring your server.
Content type
Image
Digest
sha256:61eb31e73…
Size
121.3 MB
Last updated
about 2 months ago
docker pull behringer24/mailship