Re: [exim] Re: query-style lookup for text files

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Marc Haber
CC: exim-users
Assumpte: Re: [exim] Re: query-style lookup for text files
On Sat, 1 Oct 2005, Marc Haber wrote:

> lsearch does already exist. The only thing is that the single-key
> lookup is not powerful enough to yield what needs to be done. What I
> think is necessary is to be able to read flat text files in a
> query-style lookup. This is independent of the query language being
> used, but exim's string expansion language probably is the right thing
> here.
>
> I feel like I am missing your point here.


I think I am missing your point. :-) What kind of queries would you want
to apply to a flat text file? We already have wildlsearch. Ah, I think I
see. Wildlsearch has the wildness in the file. You want it to be in the
query. Is that right? Something like "apply this regex to each line in
the file until it matches, and then set $1, $2, etc in the 'found'
expansion"? Is that it? The natural syntax for that would be

${lookup regex{/some/file regex}{found-string}{not-found-string}}

I'll put this on the Wish List.

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book