Re: [exim] combining authentication methods

Top Pagina
Delete this message
Reply to this message
Auteur: Stephen Gran
Datum:  
Aan: exim-users
Onderwerp: Re: [exim] combining authentication methods
On Sun, Jun 05, 2005 at 12:10:55PM +0200, Raphael Reich said:
> I would like exim to perform a plaintext authentication like this:
>
> first exim should lookup a password file and if that fails, perform a
> mysql lookup.
> If both methods fail, the authentication should fail.


Try this:

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

I have written them as long lines to show how the bracketing and
conditioning works - feel free to actually make it readable.
--
--------------------------------------------------------------------------
|  Stephen Gran                  | I know it all.  I just can't remember   |
|  steve@???             | it all at once.                         |
|  http://www.lobefin.net/~steve |                                         |

--------------------------------------------------------------------------