Roundcube and SnappyMail not working

Dear community,

I have been struggling to restore functionality of webmail, I already have tried to change ownership and permissions of roundcube and no luck, I reinstalled roundcube and snappymail through the v-add-sys-* CLI commands and still no luck, I believe the issue started after upgrade from php8.1 to 8.2 but downgrade has also not worked… not sure I followed the right steps at the right order…

Any help is greatly appreciated

Hestia 1.8.11
Ubuntu 22.04.3 LTS

Best regards

This is the output after running the following command:


PHP Fatal error:  Uncaught Error: Call to undefined function mb_internal_encoding() in /var/lib/roundcube/program/lib/Roundcube/bootstrap.php:86
Stack trace:
#0 /var/lib/roundcube/program/include/iniset.php(78): require_once()
#1 /var/lib/roundcube/program/include/clisetup.php(25): require_once('...')
#2 /var/lib/roundcube/bin/ require_once('...')
#3 {main}
  thrown in /var/lib/roundcube/program/lib/Roundcube/bootstrap.php on line 86
Fatal error: Please check the Roundcube error log and/or server error logs for more information.

What owner/group and perms are you using?

This should fix your issues, at least when the error appeared, now I don’t know if you did anything else to the installation.


chown -R hestiamail:www-data /etc/roundcube/
find /etc/roundcube/ -type f -iname "*php" -exec chmod 640 {} \;
chown -R hestiamail:www-data /var/lib/roundcube/
chown -R hestiamail:www-data /var/log/roundcube/


chown -R hestiamail:www-data /etc/snappymail/
chown -R hestiamail:www-data /var/lib/snappymail/

As you have upgraded/downgraded… where is your www.conf now?

find /etc/php/ -name "www.conf"

Thank you so much for the reply, I tried both instructions but still failing,

here is the output of the find command:


I think you did more things than needed…

Is php 8.2 your default php?

php -v | head -1

Yes, unfortunately some configuration got messed up :frowning:

It’s worth mentionting that I also did apt upgrade but selected to leave local config untouched.

Here is the output:

PHP 8.2.14 (cli) (built: Dec 21 2023 20:19:50) (NTS)

PHP is ok.

I don’t know, we can try to reinstall roundcube (deleting also the db), don’t know if you had data that you want to save…

If you agree I’ll show you the commands…

Yes please that would be helpful, I tried to delete roundcube and snappymail dbs and db users through phpmyadmin and then run v-add-sys-roundcube/v-add-sys-snappymail but maybe I missed something.

btw, here is a screenshot of the webmail error screen just for reference:

You must execute below commands as root and one by one to avoid errors.

First, backup roundcube:

mkdir /root/backup_roundcube/
tar pzcf /root/backup_roundcube/backup_roundcube_2023-12-29.tar.gz /etc/roundcube /var/lib/roundcube /var/log/roundcube
mysqldump --defaults-file=/usr/local/hestia/conf/.mysql.localhost --single-transaction --routines -B roundcube | gzip > /root/backup_roundcube/roundcube.sql.gz

Delete db, db user and one file in roundcube installation (Hestia script v-add-sys-roundcube will remove all later):

mysql -uroot -e 'DROP DATABASE IF EXISTS roundcube'
mysql -uroot -e 'DROP USER 'roundcube'@'localhost''
rm /var/lib/roundcube/index.php

Now install roundcube:


Change perms:

chown -R hestiamail:www-data /etc/roundcube/
find /etc/roundcube/ -type f -iname "*php" -exec chmod 640 {} \;
chown -R hestiamail:www-data /var/lib/roundcube/
chown -R hestiamail:www-data /var/log/roundcube/

And now, all should work as expected… I hope so :wink:

1 Like

Thank you again so much!

I ran the command:

tar pzcf /root/backup_rouncube/backup_roundcube_2023-12-29.tar.gz /etc/roundcube /var/lib/roundcube /var/log/roundcube

and got this output:

tar: Removing leading `/' from member names
tar (child): /root/backup_rouncube/backup_roundcube_2023-12-29.tar.gz: Cannot open: No such file or directory
tar (child): Error is not recoverable: exiting now
tar: Removing leading `/' from hard link targets
tar: /root/backup_rouncube/backup_roundcube_2023-12-29.tar.gz: Cannot write: Broken pipe
tar: Child returned status 2
tar: Error is not recoverable: exiting now

Sorry, i mistyped roundcube as rouncube, I fixed it in previous post, the right command is:

tar pzcf /root/backup_roundcube/backup_roundcube_2023-12-29.tar.gz 

Oh you are right I did not notice the typo, I finished running all the commands, no errors thrown!

The webmail interface still shows error, should I try to restart any service or the whole vm?

I would reboot the vm just to be sure all services restart correctly.

If after reboot doesn’t work too, then rebuild the mail domain:

if your user is jperusm and your domain is the command would be:

v-rebuild-mail-domain jperusm

Done reboot
Done v-rebuild-mail-domain

Apparently all is fine but roundcube still shows error. :frowning:

Ok, last shot.

Edit file /etc/apache2/apache2.conf and add these lines at top, or end, it doesn’t matter:

<Directory />
    AllowOverride ALL

Save the file, restart apache and try again:

systemctl restart apache2

The file does not exist, the folder does though…

# systemctl status apache2
Unit apache2.service could not be found.

nginx is running.

Just for the records.

I’ve been talking with @jperusm and we fixed the issue. The mbstring module was missing.

apt install php8.2-mbstring

Select more options in the domain name settings and specify PHP version 8.2 to work properly