Re: [Exim] string expansion problem while lookup

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Phil Pennock
Data:  
Para: volker augustin
CC: exim-users
Assunto: Re: [Exim] string expansion problem while lookup
On 2002-05-03 at 18:59 +0200, volker augustin wrote:
> i want to use in my acl:
>
> deny_senders = ! ${lookup pgsql{select name,dom from address
> }{$name@$dom}}
>
> as an expression to verify the senders against a valid list....


So you'll extract the _complete_ list of all name,dom from the database,
for each query?

How about figuring out where you'll use the ACL; then look at which
variables are available from Exim. Then look at a WHERE clause in your
SQL, to limit the amount of data.

> but the variables $name and $dom did not exist .... i got failures...


Please read section 9.14 of the Specification. This is doc/spec.txt
inside the source tree, or in HTML form on the website and its mirrors.

"9.14 More about MySQL, PostgreSQL, and Oracle" describes exactly how
the data is returned. It doesn't claim that Exim's own variable
namespace will be polluted by SQL calls.

Then, read section "10.12 Address lists" and especially the third
bullet-point, which includes an example of "deny senders =" and a MySQL
lookup.

You really don't need the data from the lookup. You do need a yes/no
answer to "is this sender in this database?". So a WHERE clause with an
AND and two checks. All inside the SQL, so the checks are performed on
the SQL server side and very little data needs to be (slowly) passed
around.

And read all of section "37. ACCESS CONTROL LISTS". Especially 37.3 for
which variables are available to you.

Read that stuff. Then try again. If you're still having problems, post
what you've managed to figure out and someone (perhaps me) will walk
through it with you and help you in more detail. If you can explain
exactly which bits of the documentation are causing you problems, then
we can take note and work on improved text to offer Phil Hazel when he
returns to his regular desk.
--
Experience is something you don't get until just after you need it.