Re: [Exim] lookup like a host list?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Marc Haber
CC: exim-users
Subject: Re: [Exim] lookup like a host list?
On Tue, 5 Mar 2002, Marc Haber wrote:

> A host list lookup seems to do a lot more than a normal lookup. I'd
> like to be able to write something like
> if ("${lookup{$sender_host_address} host-list {/etc/exim/scan_hosts}
> {$value}}" is "scan)
> which would do the lookup in /etc/exim/scan_hosts like for a host
> list, e.g. automatically match IP addresses, probably in CIDR
> notation, _and_ host names, probably with wild cards.


There is no way of doing this at present. I see what you are trying to
do, though that isn't really a "lookup" like the others. For a start,
you are implying linear processing of a file rather than key=>value
indexing. Also, host list matching doesn't return a value (in general),
so this really is a different kind of beast altogether.

At present, you'll have to do this with a series of lookups for the IP
address, the masked IP address, and the host name. They can all look in
the same file, of course. However, the benefit is that you can make it a
DBM or cdb file, and thereby get reasonable performance for large lists.


--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.