This docker container will spin up a simple IMAP server, using dovecot. The mailboxes can be configured through environmental variables. This can be used, in order to clean up cloud-based accounts, or when cancelling existing accounts. This long-term, low maintenance solutions keeps the messages viewable and searchable through a regular mail client. There is no WebUI, just an IMAP backend.
This container currently expects a valid SSL certificate in order to not fail the health-check. Let me know if there is any need to make this optional.
The following environmental variables can be used for configuration:
IMAP_USER_N
The user definition in the format<username>:<password>
, whereN
is the index starting at1
, e.g.IMAP_USER_1
.
At least one user (i.e.IMAP_USER_1
) needs to be defined. The user db will be re-generated on every startup.
The following paths are recommended for persisting state and/or accessing configurations
/mail-data
Location of the mailboxes (Required)/ssl
This is where the SSL private key (./key.pem
) and certificate (./fullchain.pem
) are expected. It is possible to map this to the respective folder for this mail server's domain withinacme-companion
(Required)/conf
Location of the user db (./users
), which will be generated on startup - if the correct environment variables are set - and the Diffie Hellmann parameters (./dhparams.pem
), which will be generated if not present on startup, will be stored (Recommended)/etc/dovecot/docker-conf.d/
An optional directory to overwrite the dovecot configuration provided by this container (files matching*.conf
will be read in ASCII order). See available settings and documentation of importing.
Usage with acme-companion
& nginx-proxy
, where /opt/docker/nginx-proxy/volumes/certs/
is the mapped volume of those two, inside of predefined steilerGroup
network.
version: '2'
services:
mail-archive:
image: steilerdev/mail-archive:latest
container_name: mail-archive
restart: unless-stopped
environment:
LETSENCRYPT_HOST: mail.doe.net
IMAP_USER_1: "john@archive.doe.net:super-secure-password"
ports:
- "993:993"
volumes:
- /opt/docker/mail:/mail-data
- /opt/docker/nginx-proxy/volumes/certs/mail.doe.de:/ssl:ro
- /opt/docker/mail-archive/volumes/conf:/conf
networks:
default:
external:
name: steilerGroup