Exim config to route email to certain domains through another provider?

unco

Active Member
Jun 17, 2010
43
7
58
Southern Pines, NC
Hi folks,

There's a regional bank with which a ton of people in our area do business. We route all our mail out through SpamExperts. The bank has a rule on their Barracuda ESS that prohibits any mail from a non-US IP address from being delivered to their accounts. I have tried numerous times to contact them by phone and by email, but they never respond. I have asked my customers to contact them. Apparently, they will whitelist individual email addresses if the customer complains. However, we have customers who are attorneys, accountants, realtors, etc (lots) who need to do business with them.

I would like configure Exim to change the route for any mail destined for thelocalbank.com to go out through another provider we use.

The logic would be as follows:
If TO or CC contains @thelocalbank.com, then send through smarthost2.

Has anyone done this and knows a config that works?

Thanks in advance,
Beth
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,304
363
Houston
There are a great deal of threads on this subject already in the forums, for example:

 

unco

Active Member
Jun 17, 2010
43
7
58
Southern Pines, NC
Hi Lauren,

What I mean is to have @something.com be sent out through another server, even localhost. I do already have routing set up for entire domains to be routed out through a particular host or hosts, but, in this case it is the destination domain I want to route.

If destined for something.com, send out through localhost or some other smarthost.
Otherwise, send out through designated smarthost.

I will do further research and try a few things. I'll let you know what I find.

Thanks,
B
 

rackaid

Well-Known Member
Jan 18, 2003
89
29
168
Jacksonville, FL
cPanel Access Level
DataCenter Provider
Within the confines of WHM's editor, I think you can use a static route.


Code:
static_route:
driver = manualroute
transport = remote_smtp
route_data = ${lookup{$domain}partial-lsearch{/etc/staticroutes}}
Then in /etc/staticroutes you specify your route.

bankdomain.com: SMARTHOST_IP

You put this after the POSTMAILCOUNT section.

See: EXIM relay only if recipient is at hotmail.com for more info.