Source Code: GitHub Repository
Comprehensive, lightweight, and high-performance mail server based on Alpine Linux 3.19. Designed for speed, security, and ease of management.
Important
This repository does not include the `mailadmin` binary. You must download the latest release from the [MailAdmin repository](https://github.com/kirpicheff/mailadmin) and place it in `rootfs/opt/mailadmin/mailadmin` before building the Docker image.
To run the mail server, use the following command:
docker run -d \
--name mailserver \
--restart unless-stopped \
-v /opt/mailserver/data:/data \
-v /opt/mailserver/certs:/etc/letsencrypt \
-e MARIADB_USER=postfix \
-e MARIADB_PASS=password \
-e SETUP_PASSWORD=admin \
-e MAIN_DOMAIN=example.com \
-e MAIL_SERVER=mail.example.com \
-p 25:25 -p 80:80 -p 443:443 -p 465:465 -p 587:587 -p 993:993 -p 4190:4190 -p 9999:9999 \
kirpich/mailserver
| Port | Protocol | Service | Description |
|---|---|---|---|
| 25 | TCP | SMTP | Mail transfer between servers |
| 80/443 | TCP | HTTP/S | Webmail and Admin UI |
| 465 | TCP | SMTPS | Secure SMTP (Submission) |
| 587 | TCP | STARTTLS | SMTP Submission |
| 993 | TCP | IMAPS | Secure IMAP access |
| 4190 | TCP | SIEVE | Remote Sieve management |
| 9999 | TCP | ADMIN | MailAdmin custom panel |
For your mail server to work correctly and not end up in spam, you MUST configure these records in your DNS:
example.com. IN MX 10 mail.example.com.mail.example.com. IN A <Your-IP>v=spf1 mx a -all/data/dkim/mail.txt and add it as a TXT record for mail._domainkey._dmarc IN TXT "v=DMARC1; p=none; rua=mailto:[email protected]"| Variable | Description | Default |
|---|---|---|
MAIN_DOMAIN | Your primary mail domain | example.com |
MAIL_SERVER | FQDN of the mail server | mail.example.com |
MARIADB_USER | Database user for mail services | postfix |
MARIADB_PASS | Database password | password |
SETUP_PASSWORD | Password for the MailAdmin panel | admin |
MESSAGE_SIZE | Max email size (bytes) | 52428800 |
UPLOAD_SIZE | PHP Upload Max Filesize | 25M |
All important data is stored in the /data volume (map this to a persistent path on your host):
/data/mail: Mailboxes (vmail storage)/data/mysql: MariaDB databases and system tables/data/cert: Let's Encrypt certificates/data/dkim: OpenDKIM keys and configs/data/rspamd: Spam filtering rules, Bayes databases, and maps/data/fail2ban: Security logs and sqlite databaseTo update to the latest version, run:
docker pull kirpich/mailserver
docker stop mailserver
docker rm mailserver
# Re-run your start command or script
Note
If you are using the source repository, you can use the included `update.sh` (for regular updates) or `upgrade.sh` (for database migrations) helper scripts.
This project is licensed under the MIT License - see the LICENSE file for details.
Content type
Image
Digest
sha256:39b272fbb…
Size
215.4 MB
Last updated
3 days ago
docker pull kirpich/mailserver