Re: [EXIM] rewriting user addresses

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Christopher Petro
CC: exim-users
Subject: Re: [EXIM] rewriting user addresses
On Mon, 26 Jan 1998, Christopher Petro wrote:

> So I want to do something like this:
>      lsearch;/usr/exim/users.nyuhs@* $1@???
> so that users are looked up in a series of files until they are found, and
> then their addresses are rewritten appropriately.  The above example did
> not work, though.  Am I doing something wrong?  the exmples all involved
> doing searches on domains, not userids, so I'm not sure if this is even
> supported...


Chapter 33 covers this. The form you have used (lookup for the local
part, non-lookup for the domain) is not supported. Indeed what you have
written doesn't seem sensible, as you are going to rewrite a local part
*whatever* the domain - surely you don't want to mess with local parts
in foreign domains that just happen to be the same as yours?

I suspect you might be better off writing it like this:

*@domain1 ${lookup{$local_part}lsearch{/usr/exim/user.$domain}{$value}fail}

repeated for each domain, if there are a few of them (or maybe even
using *@*.nyuhs.net if that can be used to match all the domains) or
matching the domain with

*@lsearch;/usr/exim/domains.to.be.rewritten

if there are a large number of them (in which case dbm would be faster
than lsearch in any case).

-- 
Philip Hazel                   University Computing Service,
ph10@???             New Museums Site, Cambridge CB2 3QG,
P.Hazel@???          England.  Phone: +44 1223 334714



--
*** Exim information can be found at http://www.exim.org/ ***