I have a dedicated server on which there are a number or virtual hosts. For one of the virtual hosts (mydomain.co.uk) the customer has an email server of their own to which email is routed by setting the mx record to that servers ip address. So email sent to mydomain.co.uk from any server on the internet arrives at my dedicated server and is routed to the customer's email server. However if one of the virtual hosts on the dedicated server emails mydomain.co.uk the email bounces.
I assume the email from anyone on the dedicated server to mydomain.co.uk is trying to be delivered locally but the server is not handling mydomain.co.uk email. So the server bounces it back. This also means form generated emails on the website for mydomain.co.uk never arrive as they are trying to be delivered locally.
Is there a way of getting the server to route emails for mydomain.co.uk to the correct server?