Cannot update password through roundcubemail settings

Hi,
I did a stock install of Mail-in-a-Box v60 on Ubuntu 22.04 using: ‘curl -s https://mailinabox.email/setup.sh | sudo -E bash’
everything went fine.
I then added a user. All good.
Logged into roundcubemail. All good.
But when I try changing the user’s password via RoundCube settings I receive a red error box that “could not save new password”.
I checked logs here - /var/www/roundcubemail and see this message
“DB Error: [1] near “%”: syntax error (SQL Query: UPDATE users SET password=%D WHERE email=‘me@my.site.com’) in /usr/local/lib/roundcubemail/program/lib/Roundcube/rcube_db.php on line 564 (POST /mail/?_task=settings&_action=plugin.password-save)”

Am I alone in this?

Have I missed a setup step?

Any ideas

Thanks

I recently had this problem too, and in my case postfix also broke and emails stopped sending. I am not sure if they are connected (but they did coincide within minutes of each other), because I didn’t want to delay in fixing everything, Also, I am a real novice, so trying to get to bottom of it is likely beyond my abilities anyway.

You may want to check to see if everything else is working as it is supposed to. If you do need to restore, in my case creating a fresh backup of everything since postfix went down, and then using that to restore from didn’t work and the same problem reoccurred. I had to use the backup from the night before and then find -newermt from right before the working backup in the malfunctioning server’s /home/user-data/mail/mailboxes directory to get emails since, which has seemed to work and no problems so far. Luckily for me it was early morning when it happened and we only have a small group using it and didn’t have anything complicated like calendar events to worry about.

Did you guys try re-running the setup?

sudo mailinabox

I can confirm that changing the password via roundcube does not work. Note the %D in the error, which was deprecated in the roundcube password plugin a while ago. I’ll create a bug report.
Update: here it is

Yes, I did sudo mailinabox first and it ran with no errors, but it didn’t solve it, so I went straight for the restore option (and having done that process so recently, it seemed likely to be the fastest solution) next because I was too busy yesterday to attempt anything more sophisticated unfortunately --sorry.

Thanks for the reply Actually, YES, I didn’t put one and one together immediately - but I DID have postfix stop working. I am a beginner and I could not work out how to fix it. Thankfully I had only just setup, so I could start-over.

Knowing now that an attempt to change password can break your database IF I WERE YOU I’D CONSIDER DISABLING THE PASSWORD APP FOR NOW so no-one breaks things for you again (sudo nano /usr/local/lib/roundcubemail/config.inc.conf and comment out the ‘password’ in the plugin array - or delete it if the plugins are in one line. no need to restart… but check if roundcubemail loads in your browser because a typo will break it)

After re-doing an install with Ubuntu 22.04 and MIAB v60 I confirmed the same thing happened a second time. So I dropped back to Ubuntu 20.04 - but then the installer would not run - it says it requires Ubuntu 22.04 and 18.04 but not 20.04 (using ‘curl -s https://mailinabox.email/setup.sh | sudo -E bash’ and not the latest from Github).
So I dropped back to Ubuntu 18.04 and MIAB v57 installed.

On Ubuntu 18.04 with MIAB v57 changing the password through Roundcubemail works fine.

I’m guessing the move to Ubuntu 22.04 is recent and there’s still some bugs to iron out. So I’ll start with 18.04 for now.

Before downgrading, and while I was having a look around in v60 on Ubuntu 22.04 I also noticed (in /usr/local/lib/roundcubemail/plugins/password/config.inc.php) that there is a miab ‘driver’ available, but that the setup uses mysql. I read the instructions (also in config.inc.php.dist) and changed the driver to ‘miab’ and added %u and %p under user and password further down in the miab section. But it didn’t work either. It did not occur to me at the time though, that I may have already ‘broken’ postfix/the database with a failed attempt at changing the password. If I had a clean install and tried the miab driver - who knows it may have worked? Or perhaps instead of %u and %p it may want admin user and an api password.

Thanks. Just looked at your bug report and I see you also noticed that there is a miab driver too. I saw your comment that it needs admin login.

Does it actually need admin login, or might it work with the user (if you have %u and %p in the password plugin config?). I’m not familiar with how the miab api works, sorry.

It took me a few days but I finally also noticed that my postfix was not running correctly. It seems correlated with the frist time I tested changing my password with Roundcube.
For the record, I had these types of errors

dict_sqlite_lookup: /etc/postfix/virtual-alias-maps.cf: SQL prepare failed: disk I/O error?

It seems the sqlite database got broken somehow. I had to restore the database from backup to get postfix working.
For now it seems a good recommendation not to use the password changing functionality of Roundcube.
Update: confirmed by ddavness

i have the some problem. not sure how to recover from the sql error, not able to receive or send emails

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.