Hello,
I’m trying to setup a dockerized mail server, with docker-mailserver behind Traefik.
The brief settings are like:
services:
gateway:
image: traefik:latest
ports:
# ...
# Dashboard
- 127.0.0.1:8080:8080
# SMTP
- 25:25
#...
command:
# ...lot of other entrypoints
- --entrypoints.smtp.address=:25
# ...lot of other settings
#...
mail-service:
image: docker.io/mailserver/docker-mailserver:latest
#...
labels:
- "traefik.enable=true"
# SMTP (25)
- "traefik.tcp.services.mail_site-smtp.loadbalancer.server.port=25"
- "traefik.tcp.routers.mail_site-smtp.rule=Host(`*`)"
- "traefik.tcp.routers.mail_site-smtp.entrypoints=smtp"
- "traefik.tcp.routers.mail_site-smtp.service=mail_site-smtp"
#...other services & routers for IMAP/IMAPS/Submission, not yet dealed with
#...
All HTTP routers are working, but not the mailserver.
It doesn’t receive mails, so I tried telnet:
$ telnet mail.xxx.site 25
Excepted response is a welcome such as:
220 kangli.site ESMTP Postfix
But nothing shows up, try EHLO:
EHLO 8.8.8.8
Get error:
HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
Connection: close
400 Bad Request
Seems Traefik treated port 25 as an HTTP service, not SMTP. Looked into the entrypoint definition:
$ curl -s http://127.0.0.1:8080/api/entrypoints
The result contains:
{"address":":25","transport":{"lifeCycle":{"graceTimeOut":"10s"},"respondingTimeouts":{"readTimeout":"1m0s","idleTimeout":"3m0s"}},"forwardedHeaders":{},"http":{"sanitizePath":false,"maxHeaderBytes":1048576},"http2":{"maxConcurrentStreams":250},"udp":{"timeout":"3s"},"name":"smtp"}
I’m not sure if the ‘http’ and ‘http2’ properties matter, and have no idea where they come from. I’ve searched google and asked AI and can’t find the way out.
Any one have faced this issue? Any help would be very much appreciated, thank you!