Re: [EXIM] How to use dnsdb query lookup

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Rick.Ballard
CC: exim-users
Subject: Re: [EXIM] How to use dnsdb query lookup
On Fri, 14 May 1999, Rick Ballard wrote:

> The company I work for was just bought by another company. At
> the moment I am rewriting our old addresses by looking them up in
> a file. The new company has set up a dns lookup for the
> addresses, so I presume I can use the new style dnsdb query-style
> lookup to do this. However, I can only find dnsdb mentioned once
> in the manual, and no directions on how to use it.


There isn't much to say about it. As it says, it looks up TXT records
and returns their value. It was implemented as an experiment that looked
useful, but I don't know if anybody has ever actually used it for real.

> How do I use the dnsdb query-style lookup in a rewrite rule ?
>
> Here is my current rewrite rule:
>
> #--- replace old addresses with new addresses everywhere
> #------ If not found in the lookup table, do not rewrite
> *@old.com               ${lookup{lc:$1}dbm{/usr/exim/newaddresses}{$value@???}fail}


There is a $ missing there, immediately after "lookup".

If you rewrote that as

*@old.com ${lookup dnsdb {${lc:$1}}{$value@???}fail}

Exim would look up a TXT record for the domain name that results from
expanding "{${lc:$1}}". That of course wouldn't be good enough. You
would need to add something to make it into a fully qualified domain
name, e.g. turn the rule into something like

*@old.com ${lookup dnsdb {${lc:$1}.rewrite.dom.com}{$value@???}fail}

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



--
*** Exim information can be found at http://www.exim.org/ ***