Dovecot is an open source mail delivery agent (MDA) that deliver mail to user mailbox and provide access to mailbox for user.
Run Dovecot with self-signed certificate:
$ docker run -d \
-p 110:110 \
-p 143:143 \
-p 993:993 \
-p 995:995 \
-e DOMAIN=mail.example.com \
-e DB_HOST=db \
-e DB_USER=postfix \
-e DB_PASSWORD=password \
-e DB_NAME=postfix \
-v dovecot:/etc/dovecot/private \
-v vmail:/var/mail/vmail \
vednil/dovecot
Note: A directory /etc/dovecot/private used to store self-signed certificate and Diffie-Hellman key. Certificate will be created at container startup.
Run Dovecot with your existing Let's Encrypt certificate:
$ docker run -d \
-p 110:110 \
-p 143:143 \
-p 993:993 \
-p 995:995 \
-e SSL_KEY=/etc/letsencrypt/live/mail.example.com/privkey.pem \
-e SSL_CERT=/etc/letsencrypt/live/mail.example.com/fullchain.pem \
-e DB_HOST=db \
-e DB_USER=postfix \
-e DB_PASSWORD=password \
-e DB_NAME=postfix \
-v /etc/letsencrypt/live/mail.example.com:/etc/letsencrypt/live/mail.example.com:ro \
-v /etc/letsencrypt/archive/mail.example.com:/etc/letsencrypt/archive/mail.example.com:ro \
-v vmail:/var/mail/vmail \
vednil/dovecot sh -c 'while :; do sleep 6h & wait ${!}; doveconf 1>/dev/null && dovecot reload; done & dovecot -F'
Note: Dovecot don't get or renew Let's Encrypt certificate (e.g. you can use nginx and certbot to get and renew certificate). This image run with custom command to apply dovecot reload every 6 hours because it's required after renewing certificate.
Note: A directory /var/mail/vmail used as maibox storage. It's store all user mail.
SSL_KEYThis optional environment variable is used to set ssl_key Dovecot parameter. Use this variable to use your existing certificate in Dovecot. Set path to your private key.
SSL_CERTThis optional environment variable is used to set ssl_cert Dovecot parameter. Use this variable to use your existing certificate in Dovecot. Set path to your certificate chain.
DOMAINThis environment variable used to create self-signed certificate.
DB_HOSTMariaDB IP address or DNS name. Database store domain and mailbox names.
DB_USERDatabase user name.
DB_PASSWORDDatabase user password.
DB_NAMEDatabase name.
Content type
Image
Digest
Size
50.7 MB
Last updated
over 4 years ago
docker pull vednil/dovecot