Containers with specific Network could not connect to 127.0.0.1:25 from Host

Hello,

i have some containers running with an Network “webapps” - they can communicate without problems. But if one container try to send a mail with 127.0.0.1 to Port 25, they can not connect. Is this while, the use her own Network webapps?

If i jump in the container, i can reach the Host with his own IP (nc 192.168.33.3 25) - but nc 127.0.0.1 25 not.

How can i reach, that the container can communicate to the Port 25 of the Host (127.0.0.1)?

From a container you can not simply access 127.0.0.1 of your host. That’s what containers are for: isolation.

It only works when your are in network: host mode, but then all open ports of the container are exposed externally.

This is asked like every other day, check this post.