I have am hosting a domain and website for example.com on my ISPconfig server. However primary mail for the domain is being done on another server. DNS records are correct and it works sometimes
What is happening is that an entry is being created in /etc/postfix/local-host-names for example.com and this is causing issues when mail is relayed through the server. Mail arrives and b/c the destination domain is the same as the domain in local hostnames it is not forwarding it on to the correct mailserver but instead trying to deliver it locally. Of course it cant as the user does not exist and hence it bounces, see below
The following addresses had permanent fatal errors ----- email@example.com
(reason: 550 <firstname.lastname@example.org>: Recipient address rejected: User unknown in local recipient table)
As soon as I remove the entry in /etc/postfix/local-host-names it routes the mail correctly and it is delivered to the correct domain. However the entry re-appears again if I change/add any DNS records or of its own accord
(maybe when I restart postfix).
I have tried deleting and hashing out the domain from /etc/postfix/local-host-names but it still comes back and mail fails once again.
Any ideas would be appreciated