D
Dokploy5mo ago
khuong

Stalwart Mail Server

I spent some time configuring Stalwart. I can get dashboard to work but some other things like SMTP and IMAP is not working. I don't know how to get TLS certificate for a service without a domain. Please could anyone help?
services:
stalwart-mail:
image: stalwartlabs/mail-server:latest
container_name: stalwart-mail
expose:
- 25:25 # SMTP (with STARTTLS)
- 465:465 # SMTP over TLS
- 587:587 # Submission (with STARTTLS)

- 143:143 # IMAP (with STARTTLS)
- 993:993 # IMAP over TLS
- 8080:8080

volumes:
- stalwart_mail:/opt/stalwart-mail

environment:
- STALWART_DB_URI=${DB_CONNECTION_URI}
- STALWART_DB_USER=${DB_USER}
- STALWART_DB_PASSWORD=${DB_PASSWORD}
- STALWART_HOSTNAME=${STALWART_HOSTNAME}
- STALWART_DOMAIN=${DOMAIN}

restart: unless-stopped
labels:
- traefik.enable=true
# SMTP (25)
- traefik.tcp.routers.smtp.rule=HostSNI(`*`)
- traefik.tcp.routers.smtp.entrypoints=smtp
- traefik.tcp.services.smtp.loadbalancer.server.port=25

# SMTPS (465)
- traefik.tcp.routers.smtps.rule=HostSNI(`*`)
- traefik.tcp.routers.smtps.entrypoints=smtps
- traefik.tcp.routers.smtps.tls=true
- traefik.tcp.services.smtps.loadbalancer.server.port=465

# Submission (587)
- traefik.tcp.routers.submission.rule=HostSNI(`*`)
- traefik.tcp.routers.submission.entrypoints=submission
- traefik.tcp.routers.submission.tls=true
- traefik.tcp.services.submission.loadbalancer.server.port=587

# IMAPS (993)
- traefik.tcp.routers.imaps.rule=HostSNI(`*`)
- traefik.tcp.routers.imaps.entrypoints=imaps
- traefik.tcp.routers.imaps.tls=true
- traefik.tcp.services.imaps.loadbalancer.server.port=993

networks:
- dokploy-network

networks:
dokploy-network:
external: true

volumes:
stalwart_mail:
services:
stalwart-mail:
image: stalwartlabs/mail-server:latest
container_name: stalwart-mail
expose:
- 25:25 # SMTP (with STARTTLS)
- 465:465 # SMTP over TLS
- 587:587 # Submission (with STARTTLS)

- 143:143 # IMAP (with STARTTLS)
- 993:993 # IMAP over TLS
- 8080:8080

volumes:
- stalwart_mail:/opt/stalwart-mail

environment:
- STALWART_DB_URI=${DB_CONNECTION_URI}
- STALWART_DB_USER=${DB_USER}
- STALWART_DB_PASSWORD=${DB_PASSWORD}
- STALWART_HOSTNAME=${STALWART_HOSTNAME}
- STALWART_DOMAIN=${DOMAIN}

restart: unless-stopped
labels:
- traefik.enable=true
# SMTP (25)
- traefik.tcp.routers.smtp.rule=HostSNI(`*`)
- traefik.tcp.routers.smtp.entrypoints=smtp
- traefik.tcp.services.smtp.loadbalancer.server.port=25

# SMTPS (465)
- traefik.tcp.routers.smtps.rule=HostSNI(`*`)
- traefik.tcp.routers.smtps.entrypoints=smtps
- traefik.tcp.routers.smtps.tls=true
- traefik.tcp.services.smtps.loadbalancer.server.port=465

# Submission (587)
- traefik.tcp.routers.submission.rule=HostSNI(`*`)
- traefik.tcp.routers.submission.entrypoints=submission
- traefik.tcp.routers.submission.tls=true
- traefik.tcp.services.submission.loadbalancer.server.port=587

# IMAPS (993)
- traefik.tcp.routers.imaps.rule=HostSNI(`*`)
- traefik.tcp.routers.imaps.entrypoints=imaps
- traefik.tcp.routers.imaps.tls=true
- traefik.tcp.services.imaps.loadbalancer.server.port=993

networks:
- dokploy-network

networks:
dokploy-network:
external: true

volumes:
stalwart_mail:
6 Replies
khuong
khuongOP5mo ago
I tried define entryPoints in traefik.yml but no luck
Sang Dang
Sang Dang5mo ago
Just sharing my 2cent: Not sure about your hosting provider, but in my case I used to wasted 3 hours of tinkering around until I found out they blocked the port 25 and 465 by default and we have to submit a support ticket to open it.
khuong
khuongOP5mo ago
it's fine for ports:
PORT STATE SERVICE
25/tcp open smtp
465/tcp open smtps
587/tcp open submission
993/tcp open imaps
PORT STATE SERVICE
25/tcp open smtp
465/tcp open smtps
587/tcp open submission
993/tcp open imaps
we don't need to add something in TLS, correct?
No description
iPaderi
iPaderi5mo ago
Have you solved?
SquidSnipes
SquidSnipes5mo ago
Have you tried creating a self signed certificate and checking if the server responds?
Harvey Specter
Harvey Specter5mo ago
https://sashagoncharov19.github.io/dokploy-template-docs/mail-server I have currently opened a pull request in https://github.com/Dokploy/website/pull/2#issuecomment-2505199994 , but i'm now in hospital and can't finish it at all. You can use docker-mail server. Some exmaples you can see here: https://github.com/Dokploy/dokploy/issues/408#issuecomment-2337174099
GitHub
Add a mail server template. · Issue #408 · Dokploy/dokploy
What problem will this feature address? I face TLS certificate issues with the docker mail server application Describe the solution you'd like I'm requesting to dokploy developer to create ...

Did you find this page helpful?