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.

Exim Router For Single Domain?

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

  1. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
  3. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  4. fkatzenb

    fkatzenb Well-Known Member

    Joined:
    Sep 23, 2009
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  5. Smokier

    Smokier Registered

    Joined:
    Apr 29, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    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