Re: [exim] Outbound Mail routing

Top Page
Delete this message
Reply to this message
Author: Robert Walker
Date:  
To: exim-users, Robert Walker
Subject: Re: [exim] Outbound Mail routing
Hello Phil,

I added the code that you supplied and it did forward the emails to
the mail server mail74.mimecast.co.za unfortunately to also forwarded
all the outbound emails for the rest of the domains on the server as
well which were rejected as those wee not authorized to send through
mail74.mimecast.co.za

Just a question, If I were to specify a new domain list at the start
of the exim.conf file like so:

domainlist mimecast_domains = lsearch;/etc/mimecastdomains

With the domain listed in the 'mimecastdomains' file and then change
the code you supplied to the following:

smarthost:
driver = manualroute
domains = !+mimecast_domains
route_data = mail74.mimecast.co.za
transport = remote_smtp
no_more

Would this then theoretically only route the outbound emails for the
domain listed in the 'mimecastdomains' file?

Thank you
- Robert Walker

On Thu, Sep 6, 2012 at 1:50 AM, Phil Pennock <exim-users@???> wrote:
> On 2012-09-05 at 10:29 +0200, Robert Walker wrote:
>> So my question now is how do I go about the smarthost configuration since I
>> thought I was doing it with the 3 separate routers that I supplied in my
>> previous email which were either causing the emails to loop between the 2
>> servers for inbound and/or not routing the outbound through mimecast.
>
> It should be just one Router.
>
> I am not too familiar with the cPanel setup, but loosely:
>
>  (1) Somewhere before the first "begin" line will be a main section
>      option, "domainlist local_domains = <something>"; this is very
>      strong convention, but not technically required.  If there is not a
>      domainlist called "local_domains" defined, then hopefully something
>      equivalent has been.  Make sure that the "example.com" domain,
>      which comes inbound, is listed in that

>
>  (2) After "begin routers" and until the next "begin <something>" line,
>      you get the Routers, which are tried in order.  These can vary a
>      lot, but if the configuration is anything like the default sample
>      configuration, then they'll first handle non-local main, then
>      proceed to examine local mail in more detail.

>
>      The default configuration uses "dnslookup" to deliver to MX, but
>      you instead want something called a "smarthost" setup, to have
>      Mimecast do the routing.

>
> ----------------------------8< cut here >8------------------------------
> begin routers
>
> smarthost:
> driver = manualroute
> domains = !+local_domains
> route_data = the.server.hostname.to.receive.outbound.emails
> transport = remote_smtp
> no_more
>
> # That no_more means that for all mails which passed the preconditions
> # (ie, not in local_domains domainlist), if this router doesn't handle
> # the address, then the routing will fail and no further Routers will
> # be tried.
>
> # As long as your own domain is in local_domains, your own domain will
> # not be sent out by that Router, and whatever you have next handles
> # that mail.
>
> local_foo:
> driver = accept
> # whatever
>
> # Here, _AFTER_ you've sent off-box all mails not for your domain, you
> # have one or more Routers which handle all mail within the domains.
> # Do not use "dnslookup" or something which uses remote_smtp, if all
> # those email addresses 'live' on this box.
>
> ----------------------------8< cut here >8------------------------------
>
> It should be that simple. Make sure that mail coming in to you is not
> sent back out by you, send non-local mail out to a fixed address, then
> get on with dealing with everything local in the normal way.
>
> I expect that "staticroutes" is doing something very similar to the
> smarthost, but with a bit more complexity. You do *NOT* want your _own_
> domain, to be handled on this server, to be listed in that! You want
> that to be handled locally.
>
> -Phil