Re: [exim] combining authentication methods

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Jakob Hirsch
Date:  
À: 'Exim-users'
Sujet: Re: [exim] combining authentication methods
Raphael Reich wrote:

> server_condition = ${if or\
>                          {${lookup mysql{SELECT '1' FROM users WHERE
> username = '${quote_mysql:$2}' AND clear = '${quote_mysql:$3}'} {yes}{no}}}\


This would not work anyway, because "or" expects a condition result
(like eq, crypteq etc.) and not a string like "yes" or "no".


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)

> 435 Unable to authenticate at present (set_id=******): each subcondition
> inside an "or{...}" condition must be in its own {}


and, btw, you can easily test these things by replacing $1 and $2 with
the values to test with and feeding the whole thing to exim -be.