Re: [exim] Help with authenticating md5 mailboxes

Top Page
Delete this message
Reply to this message
Author: Mike Cardwell
Date:  
To: exim-users
Subject: Re: [exim] Help with authenticating md5 mailboxes
On 10/03/2011 14:05, Wayne Swart wrote:

> I have a small exim issue. i setup a new server like a previous one, the
> only diferrence is the mailbox passwords are md5 encrypted. now the
>
>        authentication does not work no more. is there a way i can set the
> query that does the lookup for smtp auth part to first md5 the password?
> here is

>
>          my pastie. thanks in advance. http://pastie.org/1655655


Change:

${if eq{$2}{${lookup mysql{SELECT password_hash FROM popbox WHERE
CONCAT(popbox.local_part,'@',popbox.domain_name) =
'$1'}{$value}fail}}{1}{0}}

To:

${lookup mysql{SELECT COUNT(*) FROM popbox WHERE
CONCAT(local_part,'@',domain_name) = '${quote_mysql:$1}' AND
password_hash=MD5('${quote_mysql:$2}')}}

Note. It is important to use ${quote_mysql} if you don't want to be
susceptible to SQL injection attacks.

--
Mike Cardwell https://grepular.com/ https://twitter.com/mickeyc
Professional http://cardwellit.com/ http://linkedin.com/in/mikecardwell
PGP.mit.edu 0018461F/35BC AF1D 3AA2 1F84 3DC3 B0CF 70A5 F512 0018 461F