sorry for posting to my own thread again
i made a typo mistake here
should be "quote_mysql" instead of "mysql_quota"
but the problem remains unsolved
> mysql_plain:
> driver = plaintext
> public_name = PLAIN
> server_prompts = :
> server_condition = ${perl{chk_passwd} \
> {${lookup mysql{ \
> SELECT crypt FROM mail_users \
> WHERE id='$2'}{$value}fail}}{$3}}
> server_set_id = $2
>
> mysql_cram_md5:
> driver = cram_md5
> public_name = CRAM-MD5
> server_secret = ${lookup mysql{ \
> SELECT clear FROM mail_users WHERE id='{quota_mysql:$1}'} \
> {$value}fail}
> server_set_id = $1
>
> perl script:
> #!/usr/bin/perl -w
> # argv 0 depends on mysql query
>
> use Crypt::PasswdMD5;
> use strict;
>
> sub chk_passwd {
> # Exim::log_write($_[0]);
> my $salt = $_[0];
> if (defined $salt) {
> my $c_pw = unix_md5_crypt($_[1], $salt);
>
> if ($salt eq $c_pw) {
> return "yes";
> } else {
> return "no";
> }
> } else {
> return "no";
> }
> }
>