Please clarify: "Mailu requires host-mode networking" #8
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The way I understand it, there are two options for exposing IMAP/SMTP ports.
External clients are unable to connect.
$WEB_DOMAIN. External clients can connect using theclient setup specified in
https://$WEB_DOMAIN/admin/client. The webmail client also works without issue.What is the rationale behind exposing the ports on the host only?
The README specifies "so that containers are aware of remote IP addresses" - but I'm unclear how that affects functionality.
IMAP configuration examples for context:
Host-mode
Entrypoints
Hey @amras, thanks so much for trying out co-op cloud, and for opening this ticket! 🙏
We've got a few Mailu instances running at Autonomic that use "host mode", and connections from the internet to the host-mode ports do work – I wonder if there's some problematic interaction between Docker and the firewall or networking configuration on your server which is preventing external clients from being able to connect?
The intention is definitely not to restrict those ports to local-only connections, anyway.
Mailu includes some IP-based rate limiting, and unless either Mailu's "front" container (or, if we were using Traefik entrypoints, Traefik itself) is in "host" mode, then docker swarm doesn't give access to the real originating IP, and all connections seem to be treated as coming from the same source IP, which in practice led to frequent accidental denial-of-service-style outages.
"Host mode" has seemed like an acceptable limitation because the main drawbacks seem to be that (1) it's not compatible with multi-node docker swarms and (2) it doesn't allow multiple Mailu or Traefik instances on the same host.
(1) seems reasonable because there are other unsolved blockers to multi-node (mainly, lack of multi-node SSL ingress in Traefik's community edition as of Traefik 2)
(2) likewise seemed like an acceptable down-side because Traefik requires
HostSNI(*)to route protocols which don't do SNI (server name indication), and that includes "opportunistic TLS" SMTP – which seems to be required for mail servers:https://community.traefik.io/t/tcp-proxy-with-sni-support/6976
So, there's effectively a maximum of one Mailu (or SMTP-routing Traefik) instance per swarm node anyway.
I'd personally be fine with additional entrypoints in the Traefik recipe – especially if that gives any advantages for anyone over "host mode" – in that case, I wonder what would happen if a second Mailu instance were deployed on a server (currently, I think the use of host-mode ports would make
abra app deployfail, and containers fail to launch which, while not elegant, might be clearer and more deterministic than having two services with aHostSNI(*)routing rule).This seems to be correct. I'm not certain which interaction was the problem, but I've switched back to host-mode with no further issues.
This answers my question. The additional context was also helpful. Thank you so much for the explanation!