Re: [Exim] multiple authenticators (server_condition)

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Franz Georg Köhler
Dátum:  
Címzett: Exim Users
Tárgy: Re: [Exim] multiple authenticators (server_condition)
On Do, Jul 01, 2004 at 01:08:24 +0100, Bruce Richardson <itsbruce@???> wrote:
> On Thu, Jul 01, 2004 at 01:46:33AM +0200, Franz Georg Köhler wrote:
>> Hello everyone,
>>
>>
>> what would be the easiest way of authenticating against different
>> auth sources?
>>
>>
>> I have a working mysql server_condition and now I want to add a
>> plain-text source.
>
> Do you want to check first in one authentication source and then, if
> that fails, in another?


Yes, I do.

> Or do you want to choose your authentication source depending on some
> other criteria?
>
> If you mean the first option, then you could do a string expansion
> that first did a mysql lookup to see if the username was stored in the
> mysql database and authenticated against that if so. If not, it
> should authenticate against the plain text source. Or vice versa.


I thought about that, I dod, however, experience some difficultiues
while linking those two sources.


THis is what I have:

plain:
  driver = plaintext
  public_name = PLAIN
  server_condition = "${if and { \
        {!eq {$2}{}} \
        {!eq {$3}{}} \
        {eq {${md5:$3}}{${lookup mysql { \
                        select password_hash from popbox \
                        where local_part='${extract {1}{@%!}{$2}}' \
                        and domain_name='${extract {2}{@%!}{$2}}' \
                }{$value}{*:*}}} \
        }}{1}{0}}"
  server_set_id = $2




And this is what I've tried:

plain:
  driver = plaintext
  public_name = PLAIN
  server_condition = "${if and { \
        {!eq {$2}{}} \
        {!eq {$3}{}} \
        {eq {${md5:$3}}{${lookup mysql { \
                        select password_hash from popbox \
                        where local_part='${extract {1}{@%!}{$2}}' \
                        and domain_name='${extract {2}{@%!}{$2}}' \
                }{$value}{*:*}}} \
        or {if and {{eq{$2}{ph10}}{eq{$3}{secret}}}{yes}{no}}\
        }}{1}{0}}"
  server_set_id = $2




What is the correct way of connecting two different auth statements?