Can the change of the IP of the host affect email delivery?

Hi! We have a Discourse instance running on an Ubuntu 22.04.4 LTS server. Fully updated. It is reachable at https://forum.igfae.usc.es/. Due to some changes in infrastructure, we need to change the IP address of the server. Until that change, email delivery worked fine: we use an SMTP server as a relay, authorizing the IP of the Discourse server. But, after the change, the SMTP server records delivery attempts as coming from IP 10.x.y.z (omitting the actual address to avoid any potential security disclosure).

10.x.y.z replies to ping. I guess it is some piece of communication infrastructure. Also, note that the change of the IP implied a change of class C network.

In the same server, we have other not-containerized applications that are successfully relaying on the same SMTP server. That is why I’m concluding that the behavior could be related with Discourse, with Docker, or with any interaction between both.

NetworkSettings for the container read:

        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "f80dc06362bb6982d93de5aa0301624b3932744dd4d23a8dea140c33064dec23",
            "SandboxKey": "/var/run/docker/netns/f80dc06362bb",
            "Ports": {
                "443/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "443"
                    },
                    {
                        "HostIp": "::",
                        "HostPort": "443"
                    }
                ],
                "80/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "80"
                    },
                    {
                        "HostIp": "::",
                        "HostPort": "80"
                    }
                ]
            },
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "5d6105ab3bb9d331667c9c1be73eeea8be64a5b85daffa99cb0c711df9cc0dc9",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:21:a3:2c:a4:cf",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "MacAddress": "02:21:a3:2c:a4:cf",
                    "DriverOpts": null,
                    "NetworkID": "bbfd3d524dc976e2534f3f6a9df98f49f1ee4e018d9e32a144f05b037d6df1fc",
                    "EndpointID": "5d6105ab3bb9d331667c9c1be73eeea8be64a5b85daffa99cb0c711df9cc0dc9",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "DNSNames": null
                }
            }
        }

Does it make sense for you? Do you know why the change of the IP leads to this behavior? Please, how could it be solved?

Thank you very much!

I haven’t seen this problem myself. Can you share your smpt provider?

At a guess you may need to login to your smpt account and change your discourse server IP address?

Sorry for being late with my answer. We have been struggling to understand the issue. There is some funny interaction here that is driving us nuts. I think it won’t hurt if I share here the hostname of your SMTP server, as it is a public hostname: igfae.usc.es.

No login required. The IP address of the host running Discourse is authorized. As the former one was authorized and worked always fine.

It was the change of IP of the host, which included a change of location and subnet, that is causing some interaction that causes that the packets originated in Discourse container are seen by the SMTP server as coming from the IP of an intermediary communication infrastructure element (we checked that by looking the MAC address associated to the IP).

I must insist: we have another web application running on the same server using that relay without an issue.

The change of the IP of the host running Discourse container seems the origin of these issues. Or do you mean we must change the IP in NetworkSettings?

I need to learn a lot of thing about networking, containerization, security,… :frowning: Thanks for any insight!