[Solved] Postfix/Sendmail issues on multi-domain Virtualmin server (outbound)

We have a virtualmin server running on Centos 7. It was working well up until two weeks ago, at which point it would no longer send emails. The same time, we had added new domains to the server with their own IP’s.

  • All servers have email disabled during creation, we only want this server to send emails, not receive.
  • We have setup MX rules in the BIND DNS Server indicating that mail deliveries sending from the server to local domains would be rerouted to external (google) mail servers to be delivered. This corrected an issue where the sendmail server would not send emails to customer service agents at the company who have an email address with a domain associated with the server.

Using CLI:

echo “Subject: sendmail test” | sendmail -v mypersonalemail@gmail.com
mail is delivered successfully and received

echo “Subject: sendmail test” | sendmail -v [user]@[domain “A” hosted on server]
mail is not delivered.

Aug 9 17:13:53 prod2 postfix/smtp[36084]: connect to domain"A"[external ip associated with domain]:25: Connection timed out
Aug 9 17:13:53 prod2 postfix/smtp[36084]: 7D8FE168453: to=<user]@[domain hosted on server]>, relay=none, delay=562, delays=532/0.07/30/0, dsn=4.4.1, status=deferred (connect to domain"A"[external ip associated with domain]:25: Connection timed out)

Domain “A” has BIND DNS settings set for the MX record to shoot emails to google servers.

The problem seems to be that the server is not reading this MX record. I confirmed this with the host command:
[root@prod2 ~]# host -t MX Domain “A”
Domain “A” has no MX record

I have researched and come across how to troubleshoot BIND DNS issues and Postfix issues, but nothing actually tells me how to correct this. There are 9 virtual servers on this box (likely all have the same issue, the 3 largest ones have constant entry’s in the maillog) if it makes a difference and has some light modifications (PHP 7.2, mariadb 10.2, etc…).

Please help me fix this. Thanks in advance!

After much overnight unrest and deep thought, I was able to resolve the issue; and since nobody else could answer this, I figured I would.

I fixed this by doing the following:

Make backup copies of /var/named in case you need BIND DNS again
In Virtualmin: Select Server >> Edit Virtual Server >> Enabled Features
Uncheck: DNS domain enabled?

For my outbound only email configuration, I had made sure the following were also unchecked:

Virus filtering enabled?
Mail for domain enabled?
Spam filtering enabled?

Press Save Virtual Server

Once you complete this edit for all the servers on your machine, go to Webmin:
Servers >> Postfix Mail Server >> Mail Queue
and Flush the mail queue. This forced all of my emails to send and they did send successfully.