Roundcube sqlite

jigster

Verified User
Joined
Jul 23, 2021
Messages
93
I'm working on setting up DirectAdmin so we can move all our servers away from cPanel. cPanel roundcube uses sqlite for user prefs, DA uses MySQL. We'd prefer to keep using sqlite with each user's sqlite db stored separately in their home directory. For us, this worked MUCH better than a central MySQL db because user's calendars/address books count towards their space usage, and also when moving accounts between servers the db for each user got moved with their home directory. No hassle + very simple.

Has anyone achieved converting roundcube to use sqlite? Is it possible? And is it possible to have a separate db for each user in their home dir?

Any help, pointers, how-to's would be massively appreciated!!
Thanks
 
Hello,

Never tried, but if you are still after a solution, you might try using CustomBuild hooks. For example:

Code:
mkdir -p /usr/local/directadmin/custombuild/custom/hooks/roundcube/post/
cd /usr/local/directadmin/custombuild/custom/hooks/roundcube/post/
touch convert_to_sqlite.sh
chmod 755 convert_to_sqlite.sh

and modify the file "convert_to_sqlite.sh" with instructions that might be required for your setup.

Copy a custom version of config to:

- /usr/local/directadmin/custombuild/custom/roundcube/config.inc.php

This way I believe you can get what you want.
 
Thanks for the suggestion. I did actually come up with a solution, if not a little unconventional! In roundcube config.inc.php I changed $config['db_dsnw'] to:

$userDom = preg_replace('/^webmail\./', '', $_SERVER['SERVER_NAME']);
$config['db_dsnw'] = 'sqlite:////var/www/html/roundcube/userdata/' . $userDom . '/' . $userDom . '.rcube.db?mode=0646';

This creates a separate sqlite database file for each domain in the directory I created at /var/www/html/roundcube/userdata/

All our users login to webmail directly from our site, not using the roundcube login page (another set of customisations :) ) so this works for our specific use case.
 
Back
Top