Re: [exim] combining authentication methods

Página Inicial
Delete this message
Reply to this message
Autor: Raphael Reich
Data:  
Para: Jakob Hirsch
CC: exim-users
Assunto: Re: [exim] combining authentication methods
Jakob Hirsch schrieb:
>
> server_condition = {${lookup mysql{
>     SELECT '1' FROM users
>     WHERE username = '${quote_mysql:$2}'
>     AND clear = '${quote_mysql:$3}'}
>   {yes}
>   {${if crypteq
>     {$3}
>     {${extract{1}{:}
>        {${lookup{$2} lsearch{CONFDIR/passwd}{$value}{*:*}}}}}
>     {yes}{no}
>   }}}

>
> (without guarantee for enough "}" and you need the trailing \ on every
> line)


First I have to mention, that I am not a programmer or anything
similar... (I think you easyly noticed that)

Let me get this:

I'm trying to interpret the condition you suggested above:

Perform the sql-lookup.
If it succeeds, then give back "yes".
If it fails, then the lookup is replaced by an empty string.
Then go on to the next condition.
Perform the file-lookup.
If it succeeds, then give back "yes".
If it fails, give back "no".

Is this correct?

All right. I added the missing brackets (again: as good as I could):

server_condition = {${lookup mysql{SELECT '1' FROM users WHERE username
= '${quote_mysql:$2}' AND clear = '${quote_mysql:$3}'}{yes}}}\
                      {${if
crypteq{$3}{${extract{1}{:}{${lookup{$2}lsearch{CONFDIR/passwd}{$value}{*:*}}}}}{1}{0}}}



the result was:

435 Unable to authenticate at present (set_id=********): {}{1}
(******** is a replacement)

I tried various other setups, but I did not succeed.