Re: [exim] Different target hosts and types for a Exim gatew…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Todd Lyons
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] Different target hosts and types for a Exim gateway
On Sat, Apr 17, 2010 at 4:22 PM, Ted Cooper <eximX0902w@???> wrote:
> On Fri, 2010-04-16 at 11:00 +0100, exim.ml@??? wrote:
>> Where I'm stumped is how and where I extract the destination host type
>> and have Exim resolve it (host/mx) if necessary and populate a
>> variable/data field to feed to the transport. It's probably really
>> simple, but I'm confusing myself and having some trouble getting this
>> 'clear' as a logical problem in my head.
>
> Use SQL to seperate the domains into categories for each type? ie split
> your mysql_localbox into mysql_forward_mx etc and then use the
> "domains=" line with an SQL query to target the right router.
>
> eg
> LOOKUP_FWDDOMAIN=SELECT domainname FROM client_domains WHERE domainname
> = '${mysql_quote:$domain}' AND dtype = 'forward'
> forwardomains:
>  driver = manualroute
>  domains = ${lookup mysql{LOOKUP_FWDDOMAIN}{$value}}
>  local_parts = ${lookup mysql{LOOKUP_ALL_USERS}{$value}}
>  route_data = ${lookup mysql{LOOKUP_ROUTEDATA}{$value}}
>  transport = remote_smtp


The above is typically the way that I do things as well, but in this
case, this seems a bit inefficient because it's doing 3 lookups for
this router. If the op could do a single lookup that returns all of
the data needed, he can just ${extract} to get the individual values
from the returned data. Reading the docs, it seems simple, but then
again I've never done it that way (because I've not yet had the need
to do it that way.)

Just thought I would throw out that, if it can be constructed, a
single lookup could be a bit more efficient and result in a little bit
less load. Emphasis on "if it can be constructed". You might just
make it suitably complicated that it lessens its troubleshooting
ability and also one or more of these lookups might be used elsewhere,
in the ACL's for example, and caching means that the lookup may have
already been done and so doing another, more complicated lookup makes
it worse and not better.

...before sending I always read and reread my post.  I'm basically
saying "you could do it this way unless it doesn't work for you".  I
almost didn't send it...
-- 
Regards...      Todd
I seek the truth...it is only persistence in self-delusion and
ignorance that does harm.  -- Marcus Aurealius