Changing a subdomain IP address unexpectedly affected SMTP

SYSTEM INFORMATION
Version Webmin 2.660
Version Usermin 2.560
Version Virtualmin 8.2.0 GPL
Version Apache 2.4.68

Three days ago, in Virtualmin, I changed the IP address of a subdomain.

In the “Shared address” section, I selected a different IPv4 address using a dedicated IP, checked “Already active”, and disabled IPv6.

Let’s call this subdomain test.domain.com. It belongs to a domain that is configured to send emails through SMTP, but SMTP is not supposed to have anything to do with this subdomain.

Today, I noticed that mail.domain.com, which is used as the SMTP server, was no longer recognizing the IPv4 address of its own domain correctly. Instead, it was somehow using the IP address assigned to test.domain.com.

As a result, it was impossible to send emails through SMTP from PHP.

About an hour ago, I changed the configuration of test.domain.com again and restored the original IPv4 and IPv6 addresses, making them the same as those used by mail.domain.com and domain.com.

After doing this, SMTP started working again with mail.domain.com.

Sorry if my explanation is not very clear, but I managed to fix the problem. It was not an easy issue to track down, and I wanted to share my experience in case someone else runs into something similar.