Allow user changes their password in RoundCube webmail

After installed RoundCube for my customer, they asked: user can change their own password

To do this, we have to enable password plugin of RoundCube

  1. cd plugins/password

  2. cp

  3. nano

  4. Set $rcmail_config['password_driver'] = 'sql';

  5. Save file

  6. cd ../config

  7. nano

  8. Find the line $rcmail_config['plugins'] = array(); and change to $rcmail_config['plugins'] = array( 'password');

  9. Save file

If you finish 9 steps above and access to RoundCube, you will see the Password tab in Settings section. However, you maybe meet the error:

[1305] FUNCTION xxx_roundcube.update_passwd does not exist (SQL Query: SELECT update_passwd('', '@'))

The simplest way is modify password_query:

  1. Find $rcmail_config['password_query'] in plugins/password/

  2. Change $rcmail_config['password_query'] = 'SELECT update_passwd(%c, %u)'; to $rcmail_config['password_query'] = 'UPDATE zpanel_postfix.mailbox SET password=CONCAT(\'{PLAIN-MD5}\',MD5(%p)) WHERE username=%u AND password=CONCAT(\'{PLAIN-MD5}\',MD5(%o)) LIMIT 1';

All done!