Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Exim Router For Single Domain?

Discussion in 'E-mail Discussion' started by fkatzenb, Jan 9, 2012.

  1. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    66
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    Leveraging the following example: SendGrid Documentation » Exim

    How do I set this up to work with only a single domain? I only want a single domain to be sent via an external SMTP server.

    Thanks!
    Frank
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    66
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    I guess I am confused. The example says this:

    Code:
    send_via_sendgrid:
      driver = manualroute
      domains = ! +local_domains
      transport = sendgrid_smtp
      route_list = "* smtp.sendgrid.net::587 byname"
      host_find_failed = defer
      no_more
    And your example says to edit the one file and use this Exim code:
    Code:
    static_route:
       driver = manualroute
       transport = remote_smtp
       route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
    I guess I don't understand what the following line does:

    Code:
    domains =! +local_domains
    and
    Code:
      route_list = "* smtp.sendgrid.net::587 byname"
    All I am looking to do is to allow a website to use the SendGrid SMTP service but to allow them to still use Webmail, Outlook, etc.

    Thanks!
    Frank
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    66
    Location:
    Lusby, Maryland, United States
    cPanel Access Level:
    Root Administrator
    I figured it out...

    Code:
    send_via_sendgrid:
       driver = manualroute
       domains = ! +local_domains
       senders = *@yourdomain.com
       transport = sendgrid_smtp
       route_list = "* smtp.sendgrid.net::587 byname"
       host_find_failed = defer
    The *@yourdomain.com is the sender's domain that I want to always be routed via SendGrid.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Smokier

    Smokier Registered

    Joined:
    Apr 29, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    51
    Greetings,

    Thank you to all for the bits and pieces, after some tinkering this is what works for me.

    Objective:
    Have a locally hosted domain, "MY_HOSTED.NET" send via a trusted smart host, while all other domains on server are routed normally (locally) by exim.
    Have inbound mail for "MY_HOSTED.net" still kept on CPANEL server. (No loop)
    Requires: local file /etc/staticMX, that file contains:
    MY_HOSTED.net: MY_HOSTED.net.outbound15.SMARTHOST.net

    In the PREROUTERS section.
    #routers section
    send_via_SMARTHOST:
    driver = manualroute
    domains = ! +local_domains
    senders = *@MY_HOSTED.net
    transport = smarthost_smtp
    route_list = "* MY_HOSTED.net.outbound15.SMARTHOST.net::25 byname"
    host_find_failed = defer

    In the TRANSPORTS section:
    #transports section
    SMARTHOST_smtp:
    driver = smtp
    port = 25
    hosts = ${lookup{$domain}lsearch{/etc/staticMX}}

    Upon SAVE of Exim config, service is restarted. Inbound and outbound mail for both MY_HOSTED.net and other hosted domains tested. Mail flow is as expected...
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice