[exim] Reuse query-type lookup in mutiple options

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Hubert Denkmair
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: [exim] Reuse query-type lookup in mutiple options
Hi everybody,

my name is Hubert and I'm new to this list :-)

Let's get started:

Is there a way to save a query-type lookup to a variable, so that I can
reuse the results for multiple [router|transport] options?

I want to do something like that:

begin routers
hd_filter:
  driver = redirect
  $var = ${lookup mysql { \
   SELECT login, data FROM mail  \
   WHERE domain='${quote_mysql:$domain}' \
     AND (local='${quote_mysql:$local_part}' OR local='@') \
  }}
  user = ${extract{login}{$var}}
  data = ${extract{data}{$var}}


Of course this doesn't work because i can't simply make up a new
variable called "$var".
I've searched the docs for quite long now, and I'm beginning to believe
there is no way to do something alike in exim?

I know that mysql queries are cached during delivery and doing the
lookup twice might be just as expensive as doing what I want to, but
that's ugly - after all, my production-queries are much more
complicated. Maybe I could assign the query to a macro and use it for
every option, but I think that's ugly as well :-/

A nice solution, anybody?

thx
Hubert