[sork] Using Sork-Passwd with VExim MSQL backend

James Brown jbrown at orange.net
Sun Jun 19 06:31:01 PDT 2005


Folks,

I'm fairly new to Linux in general and would really appreciate some
advice on configuring Sork on Debian (Sarge - 2.4.27-1-386).

Specifically, I'm trying to configure the sork-passwd module (v2.2.2-1)
to work with VExim (basically, an out-of-the-box Exim/MySQL config -
http://silverwraith.com/vexim/).

My problem is that when trying to change a password, I get this error:

"Failure in changing password : Incorrect Password"

 From the backends.php file, you can see I'm using MYSQL and md5-hex
encryption:

$backends['sql'] = array (
     'name' => 'Exim MYSQL Database',
     'preferred' => '',
     [...]
     ),
     'driver' => 'sql',
     'params' => array(
         'phptype'    => 'mysql',
         'hostspec'   => 'localhost',
         'protocol'   => 'tcp',
         //'port'       => 3306,
         'socket'     => '/var/run/mysqld/mysqld.sock',
         'username'   => 'horde', //Granted SELECT,INSERT,UPDATE on vexim
         'password'   => '**MYPASS**',
         'encryption' => 'md5-hex',
         'database'   => 'vexim',
         'table'      => 'users',
         'user_col'   => 'username',
         'pass_col'   => 'crypt'
     )
);

The actual schema for the 'vexim.users' table looks like this:

CREATE TABLE IF NOT EXISTS vexim.users (
	[...]
	localpart varchar(192) NOT NULL default '', //user
	username varchar(255) NOT NULL default '', //user at domain
	crypt varchar(48) default NULL, //md5 password
	[...]
	PRIMARY KEY (user_id),
	UNIQUE KEY username (localpart,domain_id),
	KEY local (localpart));

Now, to get passwords into that database, here's what I did in php:

//Encrypt plaintext password
$cryptedpassword = crypt($_POST['clear']);
//Add to database
$query = "UPDATE users SET crypt='$cryptedpassword',
           clear='{$_POST['clear']}'
           WHERE user_id={$_SESSION['user_id']}";

Having tested some ASMTP connections with exim I can confirm that the
md5 password can be read by exim by using the 'crypteq' comparison.
However, Sork is still kicking up a fuss.

Any ideas would be most valuable.

Thanks in advance,

James.



More information about the sork mailing list