Roundcube Community Forum

Release Support => Pending Issues => Topic started by: Andreji on February 16, 2023, 08:56:04 AM

Title: All Settings of the Roundcube Webmailer
Post by: Andreji on February 16, 2023, 08:56:04 AM
Hello Forum,

is there any possibilty to save all settings of the webmailer, so thet I'm able to export and use them in all may other acconts?

Best regards
Andreji
Title: Re: All Settings of the Roundcube Webmailer
Post by: Dmitry42 on February 16, 2023, 10:14:33 AM
As I know RC use database for this. So you can work with DB tables. But I think there is no special software or scripts for RC - just your fantasy and experience.

I think it can be
`preferences` longtext from TABLE `users`

Quote-- Table structure for table `users`

CREATE TABLE `users` (
`user_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(128) BINARY NOT NULL,
`mail_host` varchar(128) NOT NULL,
`created` datetime NOT NULL DEFAULT '1000-01-01 00:00:00',
`last_login` datetime,
`failed_login` datetime,
`failed_login_counter` int(10) UNSIGNED,
`language` varchar(16),
`preferences` longtext,
PRIMARY KEY(`user_id`),
UNIQUE `username` (`username`, `mail_host`)
) ROW_FORMAT=DYNAMIC ENGINE=INNODB CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Title: Re: All Settings of the Roundcube Webmailer
Post by: Dmitry42 on February 16, 2023, 10:41:57 AM
Its look like:

Query:  MariaDB [roundcube]> select preferences from users where username = '[email protected]';

Quotea:1:{s:11:"client_hash";s:16:"l2ecgI1lDAJbvzhE";}

or like this

Quotea:9:{s:6:"layout";s:10:"widescreen";s:4:"skin";s:7:"elastic";s:17:"collapsed_folders";s:125:"&test&&shared&&SHARED%2F%26BBIERQQ%2BBDQETwRJBDgENQ-&&SHARED%2FINBOX&&SHARED%2Fshared&";s:17:"message_threading";a:1:{s:9:"INBOX/123";b:0;}s:11:"drafts_mbox";s:26:"&BCcENQRABD0EPgQyBDgEOgQ4-";s:9:"sent_mbox";s:34:"&BB4EQgQ,BEAEMAQyBDsENQQ9BD0ESwQ1-";s:9:"junk_mbox";s:54:"&BB0ENQQ2BDUEOwQwBEIENQQ7BEwEPQQwBE8- &BD8EPgRHBEIEMA-";s:10:"trash_mbox";s:26:"&BCMENAQwBDsENQQ9BD0ESwQ1-";s:11:"client_hash";s:16:"0TmN1nwRgAuCGWkA";} |

depend from user settings.

So if you want do it - you can connect to DB and apply changes in table for all exists users;
Title: Re: All Settings of the Roundcube Webmailer
Post by: Dmitry42 on February 16, 2023, 10:59:44 AM
For example
1. Take preferences:

select preferences from users where username = '[email protected]';

Quote+---------------------------------------------------+
| preferences                                       |
+---------------------------------------------------+
| a:1:{s:11:"client_hash";s:16:"l2ecgI1lDAJbvzhE";} |
+---------------------------------------------------+
1 row in set (0.001 sec)

2. Set preferences to all :

update users set preferences='a:1:{s:11:"client_hash";s:16:"l2ecgI1lDAJbvzhE";}';

QuoteQuery OK, 1 row affected (0.001 sec)
Rows matched: 1  Changed: 1  Warnings: 0