Use remote smpt server

gersonfs

Active Member
Sep 30, 2007
41
0
56
Hello!

How can I configure exim to use a remote smpt server for sending e-mails?
I ask because we are having problems with hotmail and yahoo, we are in a blacklist them. So I would like to authenticate with that problematic server, but use another server for sending messages, how to do this?

Sorry my bad english!

Thanks!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
You would likely want to use a smart host router to route the emails:

Mailing List Archive: Router/Transport Problem with multiple entries

You'd need to create a file called /etc/staticroutes with the following:

Code:
domain1.com: IP#
domain2.com: IP#
domain3.com: IP#
and so on
Or, the following in the file:

Code:
domain1.com: mail.location1.com (the MX record pointing to the off site server)
domain2.com: mail.location1.com (the MX record pointing to the off site server)
domain3.com: mail.location1.com (the MX record pointing to the off site server)
and so on
Next, you would need to go to WHM > Exim Configuration Editor > Advanced Editor and locate the routers area there, then put this into that routers box:

Code:
static_route:
driver = manualroute
transport = remote_smtp_smart
route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
At that point, you'd then locate the transports section in the Advanced Editor for exim and place the following:

Code:
remote_smtp_smart:
driver = smtp
port = 25
delay_after_cutoff = false
hosts = ${lookup{$domain}lsearch{/etc/staticroutes}}
hosts_override
Save that area, then test sending an email as one of the domains to see the results.