Closed logoff closed 3 years ago
Hello, I tried to reproduce using the test suite but I was not able to achieve the described situation. Could you share your docker-compose.yml?
Thanks
This is my docker-compose.yml
file:
version: '3'
services:
cert-renewer-traefik:
image: youtous/mailserver-traefik:latest
container_name: "mailserver-traefik"
networks:
- web
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- <my-services-folder>/traefik/acme.json:/tmp/traefik/acme.json:ro # link traefik acme.json file (read-only)
environment:
- TRAEFIK_VERSION=2
- CERTS_SOURCE=file
- DOMAINS=${HOSTNAME}.${DOMAINNAME}
mail:
image: tvial/docker-mailserver:latest
hostname: ${HOSTNAME}
domainname: ${DOMAINNAME}
container_name: ${CONTAINER_NAME}
ports:
- "25:25"
- "143:143"
- 465:465
- "587:587"
- "993:993"
volumes:
- maildata:/var/mail
- mailstate:/var/mail-state
- maillogs:/var/log/mail
- ./config/:/tmp/docker-mailserver/
env_file:
- .env
- env-mailserver
labels:
- "mailserver-traefik.renew.domain=${HOSTNAME}.${DOMAINNAME}" # tag the service
- "traefik.enable=true" # use traefik v2 for certificate generation
- "traefik.port=443" # dummy port, required generating certs with traefik
- "traefik.http.routers.mail.rule=Host(`${HOSTNAME}.${DOMAINNAME}`)"
- "traefik.http.routers.mail.entrypoints=https"
- "traefik.http.routers.mail.tls=true"
- "traefik.http.routers.mail.tls.certresolver=le"
- "traefik.http.routers.mail.middlewares=redirect-webmail@docker" # /!\ the router must redirect every requests.
- "traefik.http.middlewares.redirect-webmail.redirectregex.regex=.*"
- "traefik.http.middlewares.redirect-webmail.redirectregex.replacement=https://${HOSTNAME}.${DOMAINNAME}/"
environment:
- SSL_TYPE=manual # enable SSL on the *mailserver* and store certificates in pre-defined paths
- SSL_CERT_PATH=/var/mail-state/manual-ssl/cert # don't change theses paths!
- SSL_KEY_PATH=/var/mail-state/manual-ssl/key
cap_add:
- NET_ADMIN
- SYS_PTRACE
restart: always
networks:
- web
roundcube:
image: "roundcube/roundcubemail"
container_name: "roundcube"
restart: always
networks:
- web
environment:
- ROUNDCUBEMAIL_DEFAULT_HOST=tls://${HOSTNAME}.${DOMAINNAME}:993/
- ROUNDCUBEMAIL_SMTP_SERVER=tls://${HOSTNAME}.${DOMAINNAME}:465/
labels:
- traefik.http.routers.roundcube.rule=Host(`${HOSTNAME}.${DOMAINNAME}`)
- traefik.http.routers.roundcube.tls=true
- traefik.http.routers.roundcube.tls.certresolver=le
- traefik.http.middlewares.roundcube.compress=true
- traefik.http.routers.roundcube.middlewares=roundcube@docker
volumes:
maildata:
driver: local
mailstate:
driver: local
maillogs:
driver: local
networks:
web:
external: true
web
is the network where Traefik lives.
Hello, I have a pretty standard configuration, with latests images from
tvial/docker-mailserver
and your Docker image, using Docker compose. Postfix certificate is OK, but Dovecot is the generic Let's Encrypt and never gets updated.My boot logs: