Re: [exim] Exim authenticator recursive MySQL lookup

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Axel aghi Hollanda
Date:  
À: Exim-USERS
Sujet: Re: [exim] Exim authenticator recursive MySQL lookup
Hi, Peter

My very basic authentication driver looks like this:

fixed_login:
 driver = plaintext
 public_name = LOGIN
 server_prompts = "Username:: : Password::"
 server_condition = "${if crypteq{$2} \
    {${lookup mysql{SELECT password \
                    FROM users \
                    WHERE user='${quote_mysql:$local_part:$1}'}}} \
    {yes}{no}}"
 server_set_id = $1


This works fine. What I want to do now is:

If possible, before server_condition just like "local_parts"
variable within "accept router driver":

some_var = mysql; select id from users where user =
'${quote_mysql:$local_part:$1}'

    Then, inside my server_condition:


    match {${extract {id}  {$some_var_data} {$value} {0}} {SOME_ID}


    Did it get any better? I think now it's more easy than do
recursive lookups inside server_condition.


Thanks for your help.


On Fri, 26 Nov 2004 19:29:58 -0400, Axel aghi Hollanda
<ahollanda@???> wrote:
> Hi, Peter
>
>    My very basic authentication driver looks like this:

>
> fixed_login:
>   driver = plaintext
>   public_name = LOGIN
>   server_prompts = "Username:: : Password::"
>   server_condition = "${if crypteq{$2} \
>      {${lookup mysql{SELECT password \
>                      FROM users \
>                      WHERE user='${quote_mysql:$local_part:$1}'}}} \
>      {yes}{no}}"
>   server_set_id = $1

>
>    This works fine. What I want to do now is:

>
>     If possible, before server_condition just like "local_parts"
> variable within "accept router driver":

>
>     some_var = mysql; select id from users where user =
> '${quote_mysql:$local_part:$1}'

>
>      Then, inside my server_condition:

>
>      match {${extract {id}  {$some_var_data} {$value} {0}} {SOME_ID}

>
>      Did it get any better? I think now it's more easy than do
> recursive lookups inside server_condition.

>
> Thanks for your help.
>
>
>
> On Fri, 26 Nov 2004 23:03:54 -0000, Peter Bowyer <peter@???> wrote:
> > Axel aghi Hollanda <ahollanda@???> wrote:
> > > Hi,
> > >
> > >    Is there a way to keep data from MySQL queries within a
> > > authenticator driver? Let me explain what I intend to do:

> > >
> > >    1) query for a ID from a MySQL table;
> > >    2) execute a extra lookup, within the server_condition parameter,
> > > and match the return with some value/string.

> >
> > Trying to understand what it is you want to do - where does the first query
> > get executed? Based on what inputs?
> >
> > Why not post some pseudo-code which explains how you'd like it to work?
> >
> > Peter
> >
> > --
> > ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
> >
>
> --
> Aghi
> <ahollanda % gmail dot com>
>



--
Aghi
<ahollanda % gmail dot com>