Have you ever dealt with a user that pointed their MX records to another server but email from their website or other users on the same server isn’t going there? This is because Exim on is configured to use files called localdomains and remotedomains, which tell Exim whether a domain’s email is hosted locally or remotely.
The most common symptoms of a mis-configured local/remote domain setup are:
- Errors such as “lowest numbers MX record points to localhost” – you need to add the domain to localdomains
- Email bouncing stating the user does not exist (this may also mean that the user really does not exist!) – you need to add the domain to remotedomains
- Email from the user’s site (such as a contact form) is not being delivered to their outside mail server, but external email is – you need to add the domain to remotedomains
The files controlling these actions are:
/etc/localdomains: Contain a list of domains that have email hosted locally
/etc/remotedomains: Contain a list of domains that have email hosted remotely
The remotedomains file takes precedence, so if a domain is located in both files, the mail server should use remotedomains. However, I’ve heard that on some servers, Exim will do a DNS lookup anyway and make the decision based on where the domain is actually pointed. I haven’t personally reproduced that situation, so assume the former – remotedomains takes preference over localdomains if a domain is listed in both files.
When editing zones in cPanel or WHM, there is an option to select local/remote mail delivery or to have cPanel choose for you. Checking the corresponding boxes will update the local and remote domain files.
Need to set up a secondary mail server? Check out this article: