Re: [Exim] multiple domain lookups with CRAM-MD5 authenticat…

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Colin Morey
Date:  
À: exim-users
Sujet: Re: [Exim] multiple domain lookups with CRAM-MD5 authentication
> On Tue, 30 Apr 2002, Colin Morey wrote:
>
> > ${lookup mysql{select upasswd from db1.table1 where email='$1'} {$value} \
> > {${lookup mysql{select upasswd from db1.table2 where domain='$1'} {$value} \
> > { ${lookup mysql{select password from db2.table1 where user='$1'} {$value}
> > fail}}}}} "
> > which returns a valid lookup,
> > "lookup yielded: 123456"
>
> Well, is that what you expect it to yield?
>

exactly that, and that is the password, entered at both ends,.. which is why i
don't understand why it was failing,.. and its bugging me.

> > but reports -
> > "Authentication failed for (fern.vianetworks.co.uk) [195.102.252.191]: 535
> > Incorrect authentication data"
>
> Does the user match that password?
>

username and password lookup appears to be happening correctly, but exim
doesn't appear to be noticing

> > ${lookup mysql{select password from db2.table1md5 where user='$1'}
>
> ....This point is where { is missing....
>

? where abouts,.. i would have thought there would be a } at the end of
that... *looks confused*

> > ${if or \
>
> But I think this is a red herring. The way you did it above should work.
> You don't need separate "if"s with lookups; they are already
> conditionals.

ah, o.k. that part now explains why it works if i do this,
${lookup mysql{select upasswd from db1.table1 where email='$1'} {$value} \
       {${lookup mysql{select upasswd from db1.table2 where domain='$1'}
{$value} fail}}}"


looking at it, i haven't tried it with db1.table1 and db2.table1, but the
db2.table1 lookup works in the top example.

i've tried running exim with -be -d9 but it doesn't appear to like the length
of the string, and throws part of the query as the answer, eg,
for example (apologies for the line wrapping),
${if or{${if def:value ${lookup mysql{select upasswd from db1.table1 where
email='domain'} }fail}}
{${if def:value ${lookup mysql{select upasswd from db1.table2 where
domain='domain'} }fail}
}{${if def:value ${lookup mysql{select password from db2.table1 where
user='ddomain'} }fail}}{$value}{no}}


yields,
===================
search_open: mysql "NULL"
search_find: file="NULL"
key="select password from db2.table1 where user='domain'" partial=-1
LRU list:
internal_search_find: file="NULL"
type=mysql key="select password from db2.table1 where user='domain'"
database lookup required for select password from db2.table1 where
user='domain'
MYSQL query: select password from db2.table1 where user='domain'
MYSQL new connection: host=localhost port=0 database=NULL user=luser
password=passwd
lookup yielded: 123456
ue 123456fail}}{}{no}}

===================

running the first query returns,
==============================
s where user='domain'} {} fail}}}}}
==============================
and doesn't appear to be doing any lookups, so am i missing the point of exim
-be ??

Cheers,
Colin Morey