I wonder if you can help me out... at the moment were using exim to relay our emails to an smtp_relay.

The only problem is if the user exists and has an email address it won't exit the server and send them mail using our relay.

I need it to go to the relay even if it's an internal email address.

Hope that make sense, this is how we have got our relay setup at the moment

driver = manualroute
domains = !+local_domains
transport = remote_smtp_smtpauth
route_list = * smtp.sendgrid.net:587


  • Hey guys, I thought I had managed this but unfortunately this didn't work... I tried removing the domains line... :-( – user219951 May 20 '14 at 11:31

When exim sends mail, it uses /etc/localdomains file to determine the route - either outbound (if the target domain is not in localdomains) or local delivery (if it is). So, the solution would be to remove the target domains from the /etc/localdomains file.

However, don't edit that file by hand - every edit to locally hosted DNS zone (in WHM or cPanel) will overwrite the localdomains with new values.

Instead edit the DNS zone yourself, write down the correct MX records (even if your server doesn't host zone) and pick "Remote Mail Exchanger" option in the "Email Routing" section (at the page bottom) - this way you will force WHM to remove the domain from localdomains and exim will always try to send mail to your relay.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.