Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: jtrolinger on July 30, 2016, 10:19:55 PM

Title: Password plugin for mysql vpopmail database
Post by: jtrolinger on July 30, 2016, 10:19:55 PM
I have VPOPMAIL on QMAIL using MYSQL.  To make the Password plugin work with Roundcube Webmail 1.2.0 I had to modify a couple of things. 

cd /var/www/htdocs/roundcube/plugins/password

nano drivers/vpopmaild.php
//change the hostname to host by roberto puzzanghera
//change hostname to host
-        $result = $vpopmaild->connect($hostname, $port, null);
+        $result = $vpopmaild->connect($host, $port, null);


nano config.inc.php

// Password Plugin options
// -----------------------
// A driver to use for password change. Default: "sql".
// See README file for list of supported driver names.
// We have MYSQL for our VPOPMAIL DATABASE so we use the sql driver
$config['password_driver'] = 'sql';

// SQL Driver options
// ------------------
// PEAR database DSN for performing the query. By default
// Roundcube DB settings are used.
// We have a VPOPMAIL DB  and the database and table name is vpopmail
// JDT
$config['password_db_dsn'] = 'mysql://vpopmail:PASSWORDGOESHERE@localhost/vpopmail';


// This was hard
// The username and domainname are different columns JDT
$config['password_query'] = 'UPDATE vpopmail set pw_passwd=ENCRYPT(%p,concat("$1$",right(md5(rand()),8 ),"$")),
pw_clear_passwd=%p where pw_name=%l and pw_domain=%d';

// VPOPMAIL uses salted hash so md5 JDT
$config['password_crypt_hash'] = 'md5';