8 Mar
2008
8 Mar
'08
11:27 a.m.
Hi
I would like to simulate dovecot's dovecotpw with a perl script
I tried / used
use Crypt::SaltedHash; my $csh = Crypt::SaltedHash->new(algorithm => 'SHA-1'); $csh->add($passwd_string); my $salted = $csh->generate;
also
use Digest::SHA1; use MIME::Base64; $ctx = Digest::SHA1->new; $ctx->add($passwd_string); $ctx->add('salt'); my $salted = '{SSHA}' . encode_base64($ctx->digest . 'salt' ,'');
But it doesnt work.
Basically what im doing is authenticating against a mysql db.
If i do a dovecotpw -s SSHA -p password
and update the DB, then the mail client authenticates perfectly.
If anyone can help, it would be most appreciated.
Kind Regards Brent Clark