[Exim] SMTP Authentication via MySQL

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Jens Kutilek
Date:  
À: exim-users
Sujet: [Exim] SMTP Authentication via MySQL
I have exim running with the vmail-sql setup.
Now I'd like to change my SMTP authentication method from a file
search to MySQL lookup, but I'm not sure how to write the server
condition.
This works for the file search:

fixed_login:
  driver = plaintext
  public_name = LOGIN
  server_prompts = "Username:: : Password::"
  server_condition = ${if crypteq{$2}\
    {${extract{1}{:}{${lookup{${local_part:$1}}\
    lsearch{/etc/virtual/${domain:$1}/passwd}\
    {$value}}}}}{yes}{no}}
  server_set_id = $1


The passwords are stored in a file in the format
localpart:passwordhash under /etc/virtual/<domain>/passwd.
The users login using their mail address and password because we have
several virtual domains.

The MySQL query should be something like

select password_hash from popbox,domain where local_part =
'$local_part' and popbox.domain_name = domain.domain_name and
domain.domain_name = '$domain'
(I know $domain and $localpart are not set at authentication time.)

So crypteq{$2} should be compared with password_hash, a string formed
{crypt}xxxxxxxxxxxxx, but how can I do it?

--Jens

--
Jens Kutilek
Web-Design
----------------------------------------------------
ISITRAIN Schulung und Systemlösungen GmbH
Telefon: (05303) 941014, Telefax: (05303) 941016
E-Mail: jk@???, Internet: www.isitrain.de