Luciano Bolonheis wrote:
Hi Rick... its mysql, but after java connected to the database, how do
i compare the passwords ?
It depends on the ./configure options you used when building vpopmail.
If you have clear text passwords enabled, just look at them. If not
then --enable-md5-passwords controls the format of the password. If
set, I believe md5( clear_password ) will give you a value you can
compare against, if not then crypt( clear_password ) should do the trick.
Since I don't use --enable-md5-passwords to insure compatibility between
my email passwords and my system passwords I would use something like
this (PHP code).
$Tablename depends on the --disable-many-domains option. One way all
domains are stored in a single table - 'users'. The other way each
domain has its own table, named after the domain. (I prefer the first,
and hope to remove the option from vpopmail some day.)
$Encrypted = crypt( $ClearPassword );
$Query = "
SELECT pw_name, pw_domain, pw_...
WHERE pw_name = '$UserName'
AND pw_passwd = '$Encrypted'
If this query is successful, the password is valid.