Fork of tomav/docker-mailserver to allow regular authentication and md5-challenge.
1.4K
A fullstack but simple mail server (smtp, imap, antispam, antivirus...).
Only configuration files, no SQL database. Keep it simple and versioned.
Easy to deploy and upgrade.
Includes:
Why I created this image: Simple mail server with Docker
This image allows user to sue plain and login auth methods.
/var/mail/${domain}/${username}/var/mail for data persistence[email protected])./postfix/accounts.cf./postfix/virtual./spamassassin/rules.cf/tmp in your container (see docker-compose.yml template)docker pull tvial/docker-mailserver
docker build -t tvial/docker-mailserver .
docker run --name mail -v "$(pwd)/postfix":/tmp/postfix -v "$(pwd)/spamassassin":/tmp/spamassassin -p "25:25" -p "143:143" -p "587:587" -p "993:993" -h mail.my-domain.com -t tvial/docker-mailserver
mail:
# image: tvial/docker-mailserver
build: .
hostname: mail
domainname: my-domain.com
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
volumes:
- ./spamassassin:/tmp/spamassassin/
- ./postfix:/tmp/postfix/
Volumes allow to:
docker-compose up -d mail
You can easily generate a self-signed SSL certificate by using the following command:
docker run -ti --rm -v "$(pwd)"/postfix/ssl:/ssl -h mail.my-domain.com -t tvial/docker-mailserver generate-ssl-certificate
# Press enter
# Enter a password when needed
# Fill information like Country, Organisation name
# Fill "mail.my-domain.com" as FQDN
# Don't fill extras
# Enter same password when needed
# Sign the certificate? [y/n]:y
# 1 out of 1 certificate requests certified, commit? [y/n]y
# will generate:
# postfix/ssl/mail.my-domain.com-key.pem (used in postfix)
# postfix/ssl/mail.my-domain.com-req.pem (only used to generate other files)
# postfix/ssl/mail.my-domain.com-cert.pem (used in postfix)
# postfix/ssl/mail.my-domain.com-combined.pem (used in courier)
# postfix/ssl/demoCA/cacert.pem (certificate authority)
Note that the certificate will be generate for the container fqdn, that is passed as -h argument.
If a matching certificate (files listed above) is found in postfix/ssl, it will be automatically setup in postfix and courier-imap-ssl. You just have to place them in postfix/ssl folder.
# imap
username: <[email protected]>
password: <username1password>
server: <your-server-ip-or-hostname>
imap port: 143 or 993 with ssl (recommended)
imap path prefix: INBOX
auth method: plain login md5 challenge-response
# smtp
smtp port: 25 or 587 with ssl (recommended)
username: <[email protected]>
password: <username1password>
auth method: md5 challenge-response
Things to do or to improve are stored on Github, some open by myself. Feel free to improve this docker image.
Fork, improve and PR. ;-)
Content type
Image
Digest
sha256:7b9ab0135…
Size
261.5 MB
Last updated
almost 11 years ago
docker pull hourliert/docker-mailserver