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   |
|  [EMAIL PROTECTED]             | it all at once.                         |
|  http://www.lobefin.net/~steve |                                         |
 --------------------------------------------------------------------------

-- 
## List details at http://www.exim.org/mailman/listinfo/exim-users 
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://www.exim.org/eximwiki/

Reply via email to