Roundcube password change not working

The “other CP” has had a problem with changing the password in roundcube for a long time, so I thought I’d check it out on this one. It works better here, but just doesn’t quite get it right. The password is successfully changed!! But there is still an error.
Before changing the password in roundcube, the passwd file for the domain looks like this

Before

/etc/exim4/domains/domain.com $: cat passwd
bob:{MD5}$1$7m28fOvw$zzzzzzzzzz:user:mail::/home/user::userdb_quota_rule=*:storage=0M

After changing password:

bob:{MD5}$1$0rb6vDTGwwwwwwwwwww:user:mail::/home/user::userdb_quota_rule=*:storage=M

The file is missing the quota figure, in this case 0 (ie infinity) and so password login fails with a database/driver error. Adding the number manually allows you to login with the new, changed password.

This seems to affect roundcube password change, and v-change-mail-account-password. But it works OK in HestaCP mail admin pages.

Hi @pluto
Thanks for the report, this is a known issue but you provided us additional informations. I informed @anon95304325, he’s currently working on a fix.

does anyone have a quick and dirty fix for this for the meantime?

Depends how quick and dirty you want!
In the v-change-mail-account-password script, the line that sets the password in exim is this.
str="$account:$md5:$user:mail::$HOMEDIR/$user::userdb_quota_rule=*:storage=${quota}M"

The trouble is that $quota isn’t defined anywhere before that, and it isn’t accepted on the command line. If you really want a super quick and dirty solution, you could just define quota=0 earlier in the file and it will correctly format the line. This means that the script, and therefore roundcube can both reset the password. I tried it and it seems to work. But of course you don’t have the correct mail quota set.

Your mileage may vary. Don’t hold me responsible for any zombie apocalypses triggered by this change.

Looks as though the script v-get-mail-account-value may be useful in getting the actual quota value to insert, but I didn’t have time to fiddle with that.
v-get-mail-account-value ‘admin’ ‘domain.com’ ‘johhny’ ‘quota’
=> unlimited

It is already fixed on master branch: https://github.com/hestiacp/hestiacp/commit/bc086804ed64db597164a621123321107a9f41d4