Environment: Operating system CentOS Linux 7.2.1511 Webmin version 1.791
Let's say my server's hostname is site.com. I also run various web based software packages, which send out e-mail to customers. This works great. The problem is that my server also sends out e-mail to firstname.lastname@example.org.
The problem is that the site.com e-mail is not hosted on this server, it's actually hosted on a 3rd party e-mail server, so I am not getting these e-mails. Is there a way of forcing Postfix to use the MX records for site.com, even if this is the local name of the server? The server will not be receiving ANY e-mail, just send out.
I made given below changes
in /etc/postfix/main.cf mydestination = $myhostname transport_maps = hash:/etc/postfix/transport
nano /etc/postfix/transport site.com.com relay:site.com
postmap /etc/postfix/transport postfix reload
But, postfix still tries to deliver the mail locally and returns an error saying "Recipient address rejected: User unknown in virtual alias table" Bind DNS server is running in the server. But none of the domains hosted in the server use the local nameservers and all of them use external nameservers.
I want a solution to force postfix to check the MX of all the domains (EXTERNALLY, and NOT based on the mx entries in my local Bind DNS Server ) hosted in my server and do the delivery of mails based on the mx records. If mx record of domain1 is local, let it deliver locally, if the mx record of domain2 is external mail server, let it deliver externally (even if domain2 is hosted locally)
Please help in getting this resolved.
Thanks and Regards