Re: [exim] second condition in plaintext AUTH

Pàgina inicial
Delete this message
Reply to this message
Autor: John Burnham
Data:  
A: exim-users
Assumpte: Re: [exim] second condition in plaintext AUTH

> existing code:
>
> #per
> http://mirror.olnevhost.net/pub/exim/exim-html-4.40/doc/html/s
> pec_34.html
>
>  fixed_login:
>     driver = plaintext
>     public_name = LOGIN
>     server_prompts = User Name : Password
>     server_condition = \
>       ${if and {{eq{$1}{username1}}{eq{$2}{password1}}}{yes}{no}}
>     server_set_id = $1

>
> ...and I need to add a second username and password.    
> thanks in advance.

>

Use a lookup of some type. Here's an example:

login:
  driver = plaintext
  public_name = LOGIN
  server_prompts = "Username:: : Password::"
  server_condition = "\
                      ${if and { \
{eq{$1}{${lookup pgsql{select username from eximdata where username ='$1'}}}} \
{eq{$2}{${lookup pgsql{select password from eximdata where username ='$1'}}}} \
}{yes}{no}}"
  server_set_id = $1


Probably not the most efficient way of doing things (and the password is stored
unecrypted in the database table), but it should give you an idea of where to
start looking.
John