The fix for using a remote host to route all outgoing email may be posted somewhere else on this forum, but I didn't find the correct solution if it is here. I was searching for a method for doing this right from the WHM panel and discovered that this feature is not available. This particular message thread is looking for a solution, so since I've found the solution on my own, I'll post it here so that others can get this working too.
The fix is very simple. It can't be done from the WHM panel, at least not as of Version 11.28, but you can do it manually with a text editor and very little editing.
Log into your server through SSH to a command shell as the root user. Using the text editor "pico", we'll edit the exim config file. Issue the following command:
pico /etc/exim.conf
This loads exim.conf into the editor.
Scroll down until you find the "lookuphost" router. This will be a series of lines that look like the following:
lookuphost:
driver = dnslookup
domains = ! +local_domains
#ignore verisign to prevent waste of bandwidth
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
transport = remote_smtp
Change the "driver = dnslookup" line to the following:
driver = manualroute
Then below the last line that says "transport = remote_smtp", add the following lines:
route_list = * xx.xx.xx.xx
host_find_failed = defer
no_more
The "xx.xx.xx.xx" should be replaced with the IP address of the remote email server. Use the actual IP address rather than the domain name so that exim doesn't have to repeatedly look up the IP address on every outgoing email. Make sure there is a space between the asterisk and the IP address. The asterisk indicates that ALL outgoing mail will go to the remote email server.
The "host_find_failed = defer" line will tell exim to hold the mail in its mail queue if the remote host is down for any reason. It will send the mail out once the remote host is available.
Now, press CTRL-x to save the file and exit pico. Your changes will go into effect once you restart exim. You can do that from the WHM panel or from CentOS while you are still in the shell, the following command works:
/etc/init.d/exim restart
Of course, it's beyond the scope of this message, but the remote email server will also have to be configured to relay email from your server.
One thing to remember is if you do an update to exim, your changes will most likely be overwritten and you'll have to manually edit the file again. Maybe this feature can be added to a future WHM release. It would be very easy to implement.
-Maurice