Re: [Exim] SMTP auth via MySQL Databse

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Franz Georg Köhler
Datum:  
To: exim-users
Betreff: Re: [Exim] SMTP auth via MySQL Databse
On Thu, Jun 21, 2001 at 03:41:59PM +0200, Franz Georg Köhler <lists@???> wrote:
> Hi,
> I do have a slightly changed setup of vmail-sql by Chris Lightfoot
> (http://www.ex-parrot.com/~chris/vmail-sql/), which works quite good.
>
> Now I want to implent smtp auth, which i did by creating a plain text
> passwort and the following configuration directive:
> [...]


I got some help from Daniel Einspanjer (thanks by the way...) who is
running a similar configuration, my authenticator specification now
looks like this:

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


MySQL lookup works like it should work (at least this is, what I
assume), this is what the debug output looks like:

[...]
set_process_info: 8692 handling incoming connection from
atlas.hanau.net [195.211.170.202]
SMTP>> 250 hermes.hanau.net Hello fgk at atlas.hanau.net

[195.211.170.202]
SMTP<< AUTH PLAIN
ZmdrQGZyZWVuYW1lLmNvbQBmZ2tAZnJlZW5hbWUuY29tADEyMzQ1Ng==
search_open: mysql "NULL"
search_find: file="NULL"
key="select password_hash from popbox where mbox_name = 'fgk' and
domain_name = 'freename.com'" partial=-1
LRU list:
internal_search_find: file="NULL"
type=mysql key="select password_hash from popbox where mbox_name =
'fgk' and domain_name = 'freename.com'"
database lookup required for select password_hash from popbox where
mbox_name = 'fgk' and domain_name = 'freename.com'
MYSQL query: select password_hash from popbox where mbox_name = 'fgk'
and domain_name = 'freename.com'
MYSQL new connection: host=db1.hanau.net port=0 database=db user=exim
password=passwort
lookup yielded: e10adc3949ba59abbe56e057f20f883e
plain authenticator:
$1 = fgk@???
$2 = fgk@???
$3 = 123456
expanded string: 0
SMTP>> 535 Incorrect authentication data

LOG: 0 MAIN REJECT
Authentication failed for atlas.hanau.net [195.211.170.202] (fgk): 535
Incorrect authentication data


However, it seems that exim doesn't make a md5 of $3 (crypteq{$3} is
supposed to do so, isn't it?) and therefore the lookup fails.

Another question:
Do I really need '{extract{2}{:}' (I don't think so...), there is no
colon-seperated field that needs to get seperated, is it?



I have been working several hours on this know and seem to got stuck.