I have read:
Connecting two docker containers
How to get Docker containers to talk to each other while running on my local host?
I have two docker stacks running behind an nginx proxy.
- discourse (trying to send mails).
- mailu (full email stack, Listens on 0.0.0.0:587)
The mail server works perfectly for everything coming from and going to outside. Discourse works, with the one exception that emails cannot be sent via the smtp in mailu.
NETWORK ID NAME DRIVER SCOPE
2492bbae4093 bridge bridge local
5eef88cc8484 host host local
f8c0d60ec0a2 mailu_default bridge local
7483f57ce6d3 none null local
From the host:
nc -v mydomain.de 587
Connection to mydomain.de 587 port [tcp/submission] succeeded!
Same from outside: connection succeeded
From inside the Discourse container:
mydomain.de [172.17.0.2] 587 (smtp) : Connection refused
mydomain.de [172.17.0.2] 12345 (?) : Connection refused (This is a non-existing port for cross-test)
I assume I have to create a shared connection between the containers, but could not get the syntax right.