The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Two different smarthosts for two different domains in exim

Discussion in 'E-mail Discussions' started by DigitalComunic, May 6, 2017.

  1. DigitalComunic

    Joined:
    Jan 17, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    51
    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.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  3. DigitalComunic

    Joined:
    Jan 17, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    51
    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
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,287
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page