Re: [exim] authenticate * not work

Góra strony
Delete this message
Reply to this message
Autor: G W
Data:  
Dla: exim-users
Temat: Re: [exim] authenticate * not work
> does "exim4 -bP authenticators" generate output that looks like the
> authenticators you have configured?


it shows 5 authenicator with my 2 custom on top of these:
mysql_plain authenticator:
mysql_cram_md5 authenticator:
cram_md5 authenticator:
plain authenticator:
login authenticator:

the 1st one take preference?


> And you are sure that your script does the right thing?


> I'd try authenticating manually on a telnet connection first to rule

i tried using "swaks" as Marc Habe suggested (it's a good tool)


it shows that
AUTH CRAM-MD5 ... Unable to authenticate at present
AUTH PLAIN ... Authentication succeeded


for those of you interest, here's my authenticators:

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;

#Exim::log_write('Perl test');

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";
        }
}




Thanks all