Re: [Exim] SQL-based SMTP AUTH.

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Matt Bernstein
Datum:  
To: Eric Renfro
CC: exim-users
Betreff: Re: [Exim] SQL-based SMTP AUTH.
At 10:49 -0500 Eric Renfro wrote:

>I'm trying to switch from using LDAP-based user SMTP AUTH, to PgSQL-based
>lookup AUTH.
>
>My current authenticators are like:

[snip]

I'm really surprised you're having a problem. The following works (with
valid pgsql_servers, and assuming a member table with username and
password columns)

begin authenticators

cram_md5:
driver = cram_md5
public_name = CRAM-MD5
server_secret = ${lookup pgsql{select password from member where username='$1'}{$value}fail}
server_set_id = $1

plain:
driver = plaintext
public_name = PLAIN
server_condition = ${if eq{${lookup pgsql{select password from member where username='$2'}{$value}fail}}{$3}{yes}{no}}
server_set_id = $2

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