Hi all, I need your help to test a script I wrote. This script allow you to import Roundcube sieve filters to Webtop. It is not simple to find a solution to import all filters, but it can works pretty fine.
Some Roundcube filters are not implemented in Webtop. Sometimes I found a workaround. The only filter type that is not supported by the script is “Answer with message”. Eventually you can create an Automatic Response directly in Webtop.
I can’t test all type of configurations, your help is really appreciated.
REQUIREMENTS
Access at least one time with username without domain or impersonating (without @ and *root in username filed)
Access and activate users in Webtop: if you can’t access users one by one you can activate them via admin panel, under Users management.
Get Roundcube database password. It is in /etc/roundcubemail/config.inc.php file and you can retrieve it whit this command: grep db_dsnw /etc/roundcubemail/config.inc.php
The output will be: $config['db_dsnw'] = 'mysql://roundcubemail:*dbroundcubepass*@localhost/roundcubemail';
SCRIPT CONFIGURATION
Import script into NethServer with the following command: wget https://raw.githubusercontent.com/federicoballarini/webtop5-scripts/master/rcube2webtop.php . You can save it in any directory.
Open the script with vim and insert database password by replacing text on line 14.
SCRIPT EXECUTION
You can execute the script with /usr/bin/php /var/www/html/rcube2webtop.php user domain.ext
Change /var/www/html with the path where you’ve saved the script. You can replace user with all to import all users filters. Use main domain in case of multi-domain configurations.
SCRIPT OUTPUT
Actually the script shows the output but I think it will be better to save it into a log file.
In case of “Answer with text” it will be show the following text ERROR: ANSWER WITH TEXT NOT SUPPORTED .
In case of problems with rules it will show an alert as this: NOT IMPLEMENTED
POST-SCRIPT OPERATION
At the end of the scripts each user had to go into Webtop and activate filters, after a check. To enable them, you have to change configuration on the right and set “webtop5”. Then you have to press “Save and Close” to write sieve filters file.
If you want to enable filters without user login, you can enter as user with impersonate (admin!user)
Check filters before activate them!
I wait some feedback to improve this script.
Thank you all!
Translate all the remarks in english, will be easier to people of the project to understand the way your script works
I think this should be avoided. Script could be invoked by shell, Cockpit, Webtop, and import filters from all users an related password should be a parameter as a single user and its password is.
This parameters could be filled by a form on server manager (maybe a webform with a checkbox for all users)
Consider to collect output in case of interactive use (webform), but put into a log file is important for help future troubleshooting.
If the import has been run from the same user who owns the mailbox, consider the option to send a user-oriented output email message with a readable log of what worked, what didn’t worked and last but not least the reminder to check imported filters and activate.
Maybe a link to a knowledge base/user guide with an howto for create Automatic Response
I am aware that most of the hints are not directly related to the scripts, hope that will help anyway.