[Vmail-discuss] smtp auth
Paul Warren
pdw@xxxxxxxxxxxxx
Mon, 12 Nov 2001 23:31:03 +0000
On Sun, Nov 11, 2001 at 11:12:07PM +0100, Franz Georg Köhler wrote:
> Is there anyone who is running exim smtp auth with the vmail/sql
> data?
Yep, we're doing it. I think that Eric may have found the cause of your
problems.
We do it using Exim's Perl support (performance - we've heard of it...)
I'll spare you a cut-and-paste of our config, as it's a little over
complex (support various authentication sources and methods), but the
PasswordCrypt module should make it fairly straightforward.
Try:
perl_at_startup = do '/path/to/exim.pl';
Where exim.pl is:
use lib '/path/to/vmail-sql-lib/';
use PasswordCrypt;
sub check_pw {
$password = shift;
$hash = shift;
if (PasswordCrypt::authenticate($password,$hash)) {
return "yes";
} else {
return "no";
}
}
Then in your authenticator, something like:
fixed_plain:
driver = plaintext
public_name = PLAIN
server_condition = ${perl{check_pw}{$3} \
{${lookup mysql{select password_hash from domain \
where domain_name = '$2'}{$value}fail}}}
server_set_id = $2
fixed_login:
driver = plaintext
public_name = LOGIN
server_prompts = "User Name : Password"
server_condition = ${perl{check_pw}{$2} \
{${lookup mysql{select password_hash from domain \
where domain_name = '$1'}{$value}fail}}}
server_set_id = $1
Let us know if you're still having trouble.
Paul