File and Database Lookups

You can use lookups on several different kinds of configuration items within Exim, you can specify lookups in two different types of configuration items

When building Exim you must specify what lookups you require, by default Exim will only build lsearch and dbm lookups, your lookup must be built into Exim otherwise you cannot use it.

There are two lookup styles

Single-Key Lookups

A single-key lookup involves a key/value pair combination, this is similar to NIS. The lsearch lookup can search a file and try to find a matching key at the beginning of the file, it will then obtain the value of the key. There are two other lsearch types that can perform linear searches

You can use iplsearch to lookup IP addresses for both IPv4 and IPv6 versions.

Single-key lookups can be performed on dbm files, cbd files, NIS maps and even directory lookups, I will leave you to obtain information on these types of lookups.

Exim allows you to perform partial lookups by using the partial-lsearch string. When partial- is specified Exim performs the following

You can specify a minimum limit of three non-asterisk components by using a number on the partial i.e.partial3-lsearch, there are a number of other partial matches you can i have listed then below

Search Type Key Sequence
partial-lsearch a.b.c,   *.a.b.c,   *.b.c
partial(.)lsearch a.b.c,   .a.b.c,    .b.c
partial()lsearch a.b.c,   b.c
partial0(*.)lsearch a.b.c,   *.a.b.c,   *.b.c,   *.c,   *
partial0(.)lsearch a.b.c,   .a.b.c,   .b.c,   .c,   .
partial0()lsearch a.b.c,   b.c,   c

Query Style Lookups

There are number of Query style lookups you can perform, such LDAP, SQL databases, direct DNS lookups as I do not have any experience with these I will leave you to investigate how they work.