Re: [Exim] Modifying Key For Database Lookups

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Oliver Cook
Dátum:  
Címzett: exim-users
Tárgy: Re: [Exim] Modifying Key For Database Lookups
On Wed, Feb 28, 2001 at 02:31:09PM +0000, Philip Hazel wrote:

> You don't mean that literally, I presume. What you really mean, I think
> (after some thought), is "If the domain is of the form *.domain.com, how
> can I then check it's a local domain by looking up just the first
> component?"


Indeed that is what I meant. :)

> I cannot offhand think of an easy way of achieving precisely what (I
> think) you want. If you just want to treat *.domain.com as local, then
> just put *.domain.com - that will be very fast. Assuming that domain.com
> is your domain, it may not matter if you treat x.domain.com as local
> when x isn't actually valid. You can always put this as your first
> director if it matters:
>
> check_domain:
>   driver = smartuser
>   domains = *.domain.com 
>   condition = ${lookup {${extract{1}{.}{$domain}}} cdb {/usr/exim/users.cdb}\
>     {no}{yes}} 
>   new_address = :fail: Unknown domain


That is an ideal solution, thanks Philip.

It also occurred to me that my previous idea would have mistakenly treated
localpart@??? as local if subdomain was a valid username
in users.cdb - d'oh!

Ollie

-- 
Oliver Cook    Systems Administrator, ClaraNET
ollie@???      020 7903 3000 ext. 291