Two different smarthosts for two different domains in exim

Jan 17, 2009
16
4
53
Hello.

Two domains in my dedicated server need to use their smarthosts to send emails, are they mandrill and sparkpost.

I have this scenario and needing some help. I already checked all exim and cpanel docs but without success. I read some important information here, in topics of how to configure smarthosts on exim but nothing about 2 smarthosts for 2 different domains.

I get this error when I try to configure both in exim advanced editor.

Warning! directive_matcher could not parse error: 2017-05-06 23:04:21 cwd=/usr/local/cpanel/whostmgr/docroot 4 args: /usr/sbin/exim -bV -C /etc/exim.conf.test.work.IEnpfubE
2017-05-06 23:04:21 Exim configuration error:
two client authenticators (auth_client1 and auth_client2) have the same public name (LOGIN)

The problem is in public_name with the same name (LOGIN).

So, the exim settings I am using are these (users sensitive data preserved):


Section: AUTH

# domain1.com sending by mandrill
auth_client1:
driver = plaintext
public_name = LOGIN
hide client_send = : Client1 : passowrdxpto1234

#domain2.com sending by sparkpost
auth_client2:
driver = plaintext
public_name = LOGIN
hide client_send = : SMTP_Injection : keyblabla1234


Section: PREROUTERS

# domain1.com sending by mandrill
auth_client1router:
driver = manualroute
domains = ! +local_domains
condition = "${if eq {$sender_address_domain}{domain1.com}{true}{false}}"
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
headers_add = "${perl{mailtrapheaders}}"
transport = auth_client1transport
route_list = * smtp.mandrillapp.com

#domain2.com sending by sparkpost
auth_client2router:
driver = manualroute
domains = ! +local_domains
condition = "${if eq {$sender_address_domain}{domain2.com}{true}{false}}"
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
headers_add = "${perl{mailtrapheaders}}"
transport = auth_client2transport
route_list = * smtp.sparkpostmail.com


Section: TRANSPORTSTART

# domain1.com sending by mandrill
auth_client1transport:
driver = smtp
port = 587
hosts_require_auth = $host_address
hosts_require_tls = $host_address

#domain2.com sending by sparkpost
auth_client2transport:
driver = smtp
port = 587
hosts_require_auth = $host_address
hosts_require_tls = $host_address


Thanks in advance for any help.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
Jan 17, 2009
16
4
53
Hello Michael, thanks for your suggestion, I voted there, ansious awaiting for this excelent feature.

I had already seen this topic that you indicated, based on it I managed to make one smarthost work for a single domain but for 2 domains I did not succeed. Now I am in exim caving some information, but based as I read there, no one did that, yet.

greetings
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,228
463
I had already seen this topic that you indicated, based on it I managed to make one smarthost work for a single domain but for 2 domains I did not succeed. Now I am in exim caving some information, but based as I read there, no one did that, yet.
Hello,

Let us know how it works out. If it still fails, you may want to post to that thread to receive more feedback from other users using the same type of customization.

Thank you.