Quoth John Horne on Wed, Jun 21, 2000:
> new_address = "${if match {$local_part} {\\\\.} \
> {${lookup {${lc:$local_part}} cdb {TABLES/aliases.cdb} \
> {$value} fail}} \
> {${lookup {${lc:$local_part}:alias} cdb {TABLES/aliases.cdb} \
> {${lookup {${lc:$value}} cdb {TABLES/aliases.cdb} \
> {$value} fail}} fail}}}"
>
> This is within a smartuser director. Sorry it looks a bit messy.
Hmm... It looks mostly alright, except one thing. I'm not
familiar with cdb lookups, but I believe they should be generally
the same as dbm lookups. In this case, if the text file from
which you build the cdb file has entries such as:
user:alias thingie
then the key will be "user" and the data will be "alias thingie",
and _not_ "user:alias" and "thingie", which, as far as I
understand, is what you're trying to achieve.
: Philip Hazel said:
> > There are two ways to do it. The first is this:
> > ${lookup{x}lsearch{/file1}{${lookup{$value}lsearch{/file2 .... } fail}
> > The second is this
> > ${lookup{${lookup{x}lsearch{/file1}{$value}{*}}}lsearch{/file2}...
> >
> > The first way fails in the way you describe because the contents of
> > $value are reset at the start of a lookup item;
Ah. I didn't know this. So, yes, Philip seems to know what he's
talking about ;) The botton line is that this is probably the
problem, but the ":alias" thingie is probably another problem.
Vadik.
--
Prof: So the American government went to IBM to come up with a data
encryption standard and they came up with ...
Student: EBCDIC!