First time setting up a mailcow. I already have Traefik setup with wildcard certificates running a number of services which are all ok. But I cannot get mailcow to use ssl. The Mailcow UI always is insecure even though it is on https.
Would appreciate any help on figuring out what I am doing wrong.
Mailcow.conf
HTTP_PORT=8080
HTTP_BIND=127.0.0.1
HTTPS_PORT=8443
HTTPS_BIND=127.0.0.1
SKIP_LETS_ENCRYPT=y
docker compose override
services:
nginx-mailcow:
expose:
- "8080"
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx-mailcow.entrypoints=https"
- "traefik.http.routers.nginx-mailcow.rule=HostRegexp(
{hostđautodiscover|autoconfig|webmail|mail|email).+})"
- "traefik.http.routers.nginx-mailcow.rule=Host(
${MAILCOW_HOSTNAME}`)"
- âtraefik.http.routers.nginx-mailcow.tls=trueâ
- âtraefik.http.routers.nginx-mailcow.tls.certresolver=cloudflareâ
- âtraefik.http.routers.nginx-mailcow.service=nginx-mailcowâ
- âtraefik.http.services.nginx-mailcow.loadbalancer.server.port=8080â
- âtraefik.docker.network=proxyâ
networks:
proxy:
certdumper:
image: ghcr.io/kereis/traefik-certs-dumper
container_name: traefik_certdumper
restart: unless-stopped
network_mode: none
command: ârestart-containers ${COMPOSE_PROJECT_NAME}-postfix-mailcow-1,${COMPOSE_PROJECT_NAME}-nginx-mailcow-1,${COMPOSE_PROJECT_NAME}-dovecot-mailcow-1
volumes:
mount the folder which contains Traefikâs `acme.jsonâ file
in this case Traefik is started from its own docker-compose in ../traefik
- /home/me/traefik/data:/traefik:ro
mount mailcowâs SSL folder
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./data/assets/ssl/:/output:rw
environment:
- DOMAIN=mydomain.com# YOUR EMAIL SUBDOMAIN HERE
networks:
proxy: # YOUR TRAEFIK NETWORK HERE
external: true`
Traefik docker compose
services:
traefik:
image: traefik:latest
container_name: traefik
restart: unless-stopped
security_opt:
- no-new-privileges:true
networks:
- proxy
ports:
- 80:80
- 443:443
environment:
- CF_API_EMAIL=myemail
- CF_DNS_API_TOKEN=token
- CF_API_KEY=YOUR_API_KEY
be sure to use the correct one depending on if you are using a token or key
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/me/traefik/data/traefik.yml:/traefik.yml:ro
- /home/me/traefik/data/acme.json:/acme.json
- /home/me/traefik/data/config.yml:/config.yml:ro
- traefik-logs:/var/log/traefik
labels:
- âtraefik.enable=trueâ
- âtraefik.http.routers.traefik.entrypoints=httpsâ
- âtraefik.http.routers.traefik.rule=Host(traefik-dashboard.mydomain
)â
- âtraefik.http.middlewares.traefik-auth.basicauth.users=name:token.â
- âtraefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=httpsâ
- âtraefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=httpsâ
- âtraefik.http.routers.traefik.middlewares=traefik-https-redirectâ
- âtraefik.http.routers.traefik-secure.entrypoints=httpsâ
- âtraefik.http.routers.traefik-secure.rule=Host(traefik-dashboard.mydomain
)â
- âtraefik.http.routers.traefik-secure.middlewares=traefik-authâ
- âtraefik.http.routers.traefik-secure.tls=trueâ
- âtraefik.http.routers.traefik-secure.tls.certresolver=cloudflareâ
- âtraefik.http.routers.traefik-secure.tls.domains[0].main=mydomainâ
- âtraefik.http.routers.traefik-secure.tls.domains[0].sans=*.mydomainâ
- âtraefik.http.routers.traefik-secure.service=api@internalâ
networks:
proxy:
external: true
volumes:
traefik-logs: