[Exim] AUTH + SQL: MD5?

Top Page
Delete this message
Reply to this message
Author: Johannes M. Posel
Date:  
To: exim-users
Subject: [Exim] AUTH + SQL: MD5?
Hi there,

first of all thanks to everybody who already helped me out withe the
basics of AUTH and SQL!

Finally, I've got both PLAIN and LOGIN working. This is what I use:

login:
driver=plaintext
public_name=LOGIN
server_condition = ${if eq{$2} {${lookup mysql{SELECT password FROM accounts WHERE username='${local_part:$1}'}}}{1}{0}}
server_prompts="Username:: : Password::"
server_set_id=$1

login:
driver=plaintext
public_name= PLAIN
server_condition = ${if eq{$2} {${lookup mysql{SELECT password FROM accounts WHERE username='${local_part:$1}'}}}{1}{0}}
server_prompts= "Login::"
server_set_id=$1

This works, and I hope I didn't make a mistake! ;)

There's a little catch I encountered: This will not work with
CRAM-MD5, and I don't really know how I could get it to work. Browsing
the 'net, I found this one:

fixed_cram:
driver = cram_md5
public_name = CRAM-MD5
server_secret = "${if eq{$1}{$1} \
{${lookup{$1}lsearch{/etc/exim/auth}{$value}{*:*}}}fail}"
server_set_id = $1

which uses a plain text file (yes, that's what I originally asked, but
you all were right, that's not good). I've had no more ideas on how to
adapt it to MySQL, and my tries failed. I'm hoping that somebody who
has it already going (SMTP AUTH via CRAM-MD5 using MySQL table) could
share his MD5 authenticator...

TIA!
 Johannes                            mailto:jmp@its-toasted.org


--
Executive ability is deciding quickly and getting somebody else to do
the work.