query-style lookup for text files (was: [exim] [Debian] auth…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Marc Haber
Ημερομηνία:  
Προς: exim-users
Παλιά Θέματα: Re: [exim] [Debian] authentication to servers which multiple A records
Αντικείμενο: query-style lookup for text files (was: [exim] [Debian] authentication to servers which multiple A records)
On Thu, 08 Sep 2005 09:55:52 +0100, Jeremy Harris <jgh@???>
wrote:
>Marc Haber wrote:
>> Can I do a DNS lookup in a string expansion?
>
>${lookup dnsdb


That is cute. I didn't see that. However, after thinking about these
things for a long time and discussing them with some exim people in my
environment, I think that having the lookup dnsdb option is not
enough, unfortunately.

What is needed here is a lookup type which will iterate through all
lines in a text file (like lsearch) and return all records for which a
given expression is true. Clearly, this cannot be a single-key lookup
since most database backends that have a single-key interface cannot
do this, but a query-style lookup for text files (alias-file style)
will probably be possible.

What I'd like to have is something along the lines

|${lookup textfile {/etc/exim4/passwd.client; match{${lookup dnsdb{a=$1}{$value}fail}}{$host_address}}{$2}fail}}

which will return (modulo bracketing and other syntax errors) the
second field of any line (the first line?) in /etc/exim4/passwd.client
for whose first field exists an A record pointing to the IP address of
the we are actually talking to.

Is this already possible in exim? If not, I'd like to have that
possibility in a future exim version, which will probably also ease
debugging of database connectors.

Greetings
Marc

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber         |   " Questions are the         | Mailadresse im Header
Mannheim, Germany  |     Beginning of Wisdom "     | http://www.zugschlus.de/
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fon: *49 621 72739834