If you want to set up the Roundcube password plugin on a mail system that is administered with Postfixadmin, you could be in a small trouble, because it’s not supported by default.

Here are the steps,  how to adapt it’s configuration:

  1.  after you have activated the plugin within Roundcube, go to the plugin directory ~/pluigins/password and copy or rename the file config.inc.php.dist to config.inc.php  and adjust the options according to your needs
  2.  there are two lines that you’ll have to edit specifically, to set the plugin to access the SQL table created by Postfixadmin:

Around line 45, the $config[‘password_db_dsn’] – you’ll have to define the exact way that Postfiadmin is accessing the mailbox table in the database, otherwise it will default to Roundcube’s database (which is totally wrong, your mailbox passwords are defined withing Postfixadmin’s database). So it’ll look something like:

      $config[‘password_db_dsn’] = ‘mysql://username:password@localhost/postfixadmin’

where the /postfixadmin at the end is the name of the database the Postfixadmin uses (postfixadmn is the default)

And the 2nd line you need to se it the database query that will edit the password in Postfixadmin’s mailbox table around line 65:

     $config[‘password_query’] = ‘UPDATE mailbox SET password = %c, modified=now() WHERE username = %u LIMIT 1’;

One thought on “Roundcube password plugin with Postfixadmin

  1. Other config (maybe better?) – if the databases for postixadmin and roundcube is the same mysql server
    // set the apropriate hash/crypt
    $config[‘password_algorithm’] = ‘md5-crypt’;
    // leave password_db_dsn default
    $config[‘password_db_dsn’] = ”;
    // the query
    $config[‘password_query’] = ‘UPDATE postfixadmin.mailbox SET password = %P, modified = NOW() WHERE username = %u’;
    // and grant permission to database “postfixadmin” (possibly only for “mailbox”) for roundcube user (e.g. via phpmyadmin)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.