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.

Different smart host for sending emails

Discussion in 'E-mail Discussions' started by Azim, Oct 4, 2016.

Tags:
  1. Azim

    Azim Active Member

    Joined:
    Oct 16, 2015
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    India
    cPanel Access Level:
    Website Owner
    Hello All,

    Hope everyone is doing good. With the help of below URL and your support , I managed to send emails of my different domains via different SMTP providers. So currently I have two SMTP relay where first domain send emails from Google smtp and second domain sends emails from Mailgun.

    However Is this possible to send emails from a particular smtp relay to a particular recipients. So lets say,

    1. My first domain using Google smtp relay.
    2. There is a automatic email schedule via script.
    3. It sends a single copy to A@domain.com , B@domain.com and C@domain.com
    4. Since I have already configured a second smtp relay called mailgun.

    So If my first domain sends an email using Google smtp and when it sends the automatic emails, then it should take mailgun smtp relay to send email to C@domain.com.

    Please let me know if you need more details on this and please help me to implement this.

    My current Exim config is below,

    Code:
    @ROUTERSTART@:
    
    smarthost_dkim:
    
      driver = manualroute
    
      domains = !"+local_domains +smart_hosts"
    
      condition = "${if eq{${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}{$value}}}{}{false}{true}}"
    
      ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 64.94.110.0/24
    
      headers_add = "${perl{mailtrapheaders}}"
    
      require_files = "+/var/cpanel/domain_keys/private/${sender_address_domain}"
    
      transport = remote_smtp_smart_dkim
    
      route_list = !+local_domains "${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}"
    
    
    
    smarthost_regular:
    
      driver = manualroute
    
      domains = !"+local_domains +smart_hosts"
    
      condition = "${if eq{${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}{$value}}}{}{false}{true}}"
    
      ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 64.94.110.0/24
    
      headers_add = "${perl{mailtrapheaders}}"
    
      transport = remote_smtp_smart_regular
    
      route_list = !+local_domains "${lookup{$sender_address_domain}partial-lsearch{/etc/staticroutes}}"
    
    @TRANSPORTSTART@:
    
    
    remote_smtp_smart_dkim:
    
      driver = smtp
    
      hosts_require_tls = *
    
      interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
    
      helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
    
    dkim_domain = $sender_address_domain
    
    dkim_selector = default
    
    dkim_private_key = "/var/cpanel/domain_keys/private/${dkim_domain}"
    
    dkim_canon = relaxed
    
    
    remote_smtp_smart_regular:
    
      driver = smtp
    
      hosts_require_tls = *
    
      interface = ${if exists {/etc/mailips}{${lookup{$sender_address_domain}lsearch*{/etc/mailips}{$value}{}}}{}}
    
      helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}
    
    Sorry I did not paste the URL,


    Forward certain domain emails to Smart Host
     
    #1 Azim, Oct 4, 2016
    Last edited by a moderator: Oct 10, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page