Help with smarthost setup for using smarthost only for certain domain recipients

albatroz

Well-Known Member
Mar 6, 2003
401
6
168
Virtual Orbis / Peru
cPanel Access Level
Root Administrator
Twitter
I managed to setup smarthost in my WHM/Cpanel server using the EXIM basic editor
however now I would like to allow the use of the smarthost only for certain
destination emails (i.e. hotmail.com) so I was wondering if there is any tutorial that you can recommend me for this purpose.

I checked the EXIM advanced editor and noticed that my initial setup created the following lines



#
dkim_lookuphost:
driver = manualroute
route_list = * SERVER-IP:587
domains = ! +local_domains
condition = "${perl{sender_domain_can_dkim_sign}}"
#ignore verisign to prevent waste of bandwidth
ignore_target_hosts = +loopback : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
transport = dkim_remote_smtp

#
autoreply_lookuphost:
driver = manualroute
route_list = * SERVER-IP:587
domains = ! +local_domains
condition = "${if or {{match{$h_Precedence:}{auto}}{match{$h_X-Precedence:}{auto}}}{1}{0}}"
#ignore verisign to prevent waste of bandwidth
ignore_target_hosts = +loopback : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
transport = remote_smtp

#




lookuphost:
driver = manualroute
route_list = * SERVER-IP:587
domains = ! +local_domains
#ignore verisign to prevent waste of bandwidth
ignore_target_hosts = +loopback : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
transport = remote_smtp

#
literal:
driver = manualroute
route_list = * SERVER-IP:587
domains = ! +local_domains
ignore_target_hosts = +loopback : 64.94.110.0/24
headers_add = "${perl{mailtrapheaders}}"
transport = remote_smtp
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
There are quite a few forum posts on this subject already, have you taken a look at them? Some examples are as follows:

 

albatroz

Well-Known Member
Mar 6, 2003
401
6
168
Virtual Orbis / Peru
cPanel Access Level
Root Administrator
Twitter
Hello,
I hope everybody is OK despite the covid19 emergency

I am still unsuccessfully trying to use another CPanel server as a smarthost for sending emails ONLY for sending domains destinations.

So After reading this BLOG post

I added these lines to EXIM advanced configuration

** Section: POSTMAILCOUNT
send_via_mySmartHost:
driver = manualroute
domains = ! *@domain : ! *@domain1 : ! *@gmail.com : ! +local_domains
transport = remote_smtp
route_list = * IP::587
******


** Section: AUTH
mySmartHost_login:
driver = plaintext
public_name = LOGIN
******


But all emails (even gmail) are delivered via the IP listed in route_list

So I was wondering if you can give me a suggestion for fixing this

BTW:
I also read this article from the Mailchannels support site with no sucess