[exim] Using Postgres lookup for SMTP auth

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Rory Campbell-Lange
Datum:  
To: Exim Users
CC: mark
Betreff: [exim] Using Postgres lookup for SMTP auth
I'm having trouble coming up with the correct stanza to allow me to do
smtp auth using a postgresql call.

I'm trying to do something like this:

fixed_plain:
  driver = plaintext
  public_name = PLAIN
  server_prompts = :
  server_condition = \
    ${if and {{eq{$auth2}{username}}{eq{$auth3}{mysecret}}}\
      {yes}{no}}
  server_set_id = $auth2


like this:

fixed_plain:
  driver = plaintext
  public_name = PLAIN
  server_prompts = :
  server_condition = \
  server_set_id = \
    ${if and {{eq{$2}${lookup pgsql {
    SELECT password FROM users where userid || '@' || domain = '${quote_pgsql:$1}'
    }}}}{yes}{no}}
  server_set_id = $auth1


(I appreciate that there are security concerns with this example.)

I'd be grateful for any tips.

Rory

--
Rory Campbell-Lange
<rory@???>
<www.campbell-lange.net>