gianlucagiacometti / roundcube-toolbox

Set of tools for Roundcube webmail
15 stars 10 forks source link

Aliases: multi-domain support, bugfixes #27

Closed Henri-J-Norden closed 2 years ago

Henri-J-Norden commented 2 years ago

Add: $config['toolbox_aliases_multiple_domains'] option - when true, allows managing aliases from any domain to the logged-in user.

Fix #14, #19 point 3, also mentioned in #24: now() is no longer passed as a string

Fix #19 point 4: more robust JS callback event handling for alias toggle buttons (alias name is encoded into event name and duplicate listeners are avoided)

gianlucagiacometti commented 2 years ago

Thank you. Just give me a couple of days to test it on my server.

MikeWard0321 commented 2 years ago

A huge THANKS to both of you for your fantastic work on this plugin so far!

I also had the issue with adding aliases to a clean 1.6.0 install running on Ubuntu 22.04.1 with PHP 8.1 and MariaDB 10.6.7, along with some other things not working. I applied Henri's updates and can confirm aliases and multi-domain support is working as expected!

The only issue I can report is a similar incorrect datetime value error when trying to save an OOO message.

01-Oct-2022 00:15:47 -0400]: <fehbp72j> ERROR in [storage].[sql].[function save_tool_data]: cannot execute query [INSERT INTO vacation (email, domain, active, activefrom, activeuntil, interval_time, subject, body, modified, created) VALUES ('me@example.com','example.com',true,'2022-10-01 00:15:47','2022-10-11 00:15:47',0,'***** Out of Office *****','Just a test message.',now(),now());] - [1364] Field 'cache' doesn't have a default value [01-Oct-2022 00:15:47 -0400]: <fehbp72j> ERROR in [function save]: data not stored

Otherwise, same in Customize. Nothing comes up under Interface skin other than the Save button, which also doesn't work to save the purge settings.

All in all, this is freaking AWESOME!!! Thank you both SO MUCH!

gianlucagiacometti commented 2 years ago

Thanks, I will try to find a moment to check for the last issues you mentioned about

MikeWard0321 commented 2 years ago

UPDATE:

Upon further analysis, I've found the following issues:

  1. Vacation/Out-of-Office form loads, but errs when saving.
  2. Customize tab/button click loads the Purge options above the header "Interface skin" with a Save button below that errs if clicked.
  3. Attachments loads a blank section with a save button at the top left corner of the rightmost pane.

Here are the logs from each button click:

Output from tail -f ../logs/errors.log

[01-Oct-2022 08:50:31 -0400]: <tak2le3u> PHP Error: Can use only one plugin for attachments/file uploads! Using 'database_attachments', ignoring others. in /var/www/roundcube/plugins/filesystem_attachments/filesystem_attachments.php on line 39 (GET /?_task=settings&_action=plugin.toolbox) [01-Oct-2022 08:50:31 America/New_York] PHP Warning: Undefined array key "customise_blankpage" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 137 [01-Oct-2022 08:50:31 America/New_York] PHP Warning: Undefined array key "blankpage_type" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:31 America/New_York] PHP Warning: Undefined array key "blankpage_url" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:31 America/New_York] PHP Warning: Undefined array key "blankpage_image" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:31 America/New_York] PHP Warning: Undefined array key "blankpage_custom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:35 -0400]: <tak2le3u> PHP Error: Can use only one plugin for attachments/file uploads! Using 'database_attachments', ignoring others. in /var/www/roundcube/plugins/filesystem_attachments/filesystem_attachments.php on line 39 (GET /?_task=settings&_action=plugin.toolbox.edit&_section=aliases&_framed=1) [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key "customise_blankpage" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 137 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key "blankpage_type" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key "blankpage_url" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key "blankpage_image" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key "blankpage_custom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key 1 in /var/www/roundcube/plugins/toolbox/toolbox.php on line 648 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key 1 in /var/www/roundcube/plugins/toolbox/toolbox.php on line 648 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key 1 in /var/www/roundcube/plugins/toolbox/toolbox.php on line 648 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key 1 in /var/www/roundcube/plugins/toolbox/toolbox.php on line 648 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key 1 in /var/www/roundcube/plugins/toolbox/toolbox.php on line 648 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key 1 in /var/www/roundcube/plugins/toolbox/toolbox.php on line 648 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key 1 in /var/www/roundcube/plugins/toolbox/toolbox.php on line 648 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key 1 in /var/www/roundcube/plugins/toolbox/toolbox.php on line 648 [01-Oct-2022 08:50:35 America/New_York] PHP Warning: Undefined array key 1 in /var/www/roundcube/plugins/toolbox/toolbox.php on line 648 [01-Oct-2022 08:50:44 -0400]: <tak2le3u> PHP Error: Can use only one plugin for attachments/file uploads! Using 'database_attachments', ignoring others. in /var/www/roundcube/plugins/filesystem_attachments/filesystem_attachments.php on line 39 (GET /?_task=settings&_action=plugin.toolbox.edit&_section=forward&_framed=1) [01-Oct-2022 08:50:44 America/New_York] PHP Warning: Undefined array key "customise_blankpage" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 137 [01-Oct-2022 08:50:44 America/New_York] PHP Warning: Undefined array key "blankpage_type" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:44 America/New_York] PHP Warning: Undefined array key "blankpage_url" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:44 America/New_York] PHP Warning: Undefined array key "blankpage_image" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:44 America/New_York] PHP Warning: Undefined array key "blankpage_custom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:45 -0400]: <tak2le3u> PHP Error: Can use only one plugin for attachments/file uploads! Using 'database_attachments', ignoring others. in /var/www/roundcube/plugins/filesystem_attachments/filesystem_attachments.php on line 39 (GET /?_task=settings&_action=plugin.toolbox.edit&_section=vacation&_framed=1) [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "customise_blankpage" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 137 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "blankpage_type" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "blankpage_url" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "blankpage_image" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "blankpage_custom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "active" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 799 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "activefrom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 807 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "activeuntil" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 815 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "interval_time" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 828 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "subject" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 836 [01-Oct-2022 08:50:45 America/New_York] PHP Warning: Undefined array key "body" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 852 [01-Oct-2022 08:50:47 -0400]: <tak2le3u> PHP Error: Can use only one plugin for attachments/file uploads! Using 'database_attachments', ignoring others. in /var/www/roundcube/plugins/filesystem_attachments/filesystem_attachments.php on line 39 (GET /?_task=settings&_action=plugin.toolbox.edit&_section=purge&_framed=1) [01-Oct-2022 08:50:47 America/New_York] PHP Warning: Undefined array key "customise_blankpage" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 137 [01-Oct-2022 08:50:47 America/New_York] PHP Warning: Undefined array key "blankpage_type" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:47 America/New_York] PHP Warning: Undefined array key "blankpage_url" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:47 America/New_York] PHP Warning: Undefined array key "blankpage_image" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:47 America/New_York] PHP Warning: Undefined array key "blankpage_custom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:48 -0400]: <tak2le3u> PHP Error: Can use only one plugin for attachments/file uploads! Using 'database_attachments', ignoring others. in /var/www/roundcube/plugins/filesystem_attachments/filesystem_attachments.php on line 39 (GET /?_task=settings&_action=plugin.toolbox.edit&_section=preview&_framed=1) [01-Oct-2022 08:50:48 America/New_York] PHP Warning: Undefined array key "customise_blankpage" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 137 [01-Oct-2022 08:50:48 America/New_York] PHP Warning: Undefined array key "blankpage_type" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:48 America/New_York] PHP Warning: Undefined array key "blankpage_url" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:48 America/New_York] PHP Warning: Undefined array key "blankpage_image" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:48 America/New_York] PHP Warning: Undefined array key "blankpage_custom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:50 -0400]: <tak2le3u> PHP Error: Can use only one plugin for attachments/file uploads! Using 'database_attachments', ignoring others. in /var/www/roundcube/plugins/filesystem_attachments/filesystem_attachments.php on line 39 (GET /?_task=settings&_action=plugin.toolbox.edit&_section=customise&_framed=1) [01-Oct-2022 08:50:50 America/New_York] PHP Warning: Undefined array key "customise_blankpage" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 137 [01-Oct-2022 08:50:50 America/New_York] PHP Warning: Undefined array key "blankpage_type" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:50 America/New_York] PHP Warning: Undefined array key "blankpage_url" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:50 America/New_York] PHP Warning: Undefined array key "blankpage_image" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:50 America/New_York] PHP Warning: Undefined array key "blankpage_custom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:51 -0400]: <tak2le3u> PHP Error: Can use only one plugin for attachments/file uploads! Using 'database_attachments', ignoring others. in /var/www/roundcube/plugins/filesystem_attachments/filesystem_attachments.php on line 39 (GET /?_task=settings&_action=plugin.toolbox.edit&_section=attachments&_framed=1) [01-Oct-2022 08:50:51 America/New_York] PHP Warning: Undefined array key "customise_blankpage" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 137 [01-Oct-2022 08:50:51 America/New_York] PHP Warning: Undefined array key "blankpage_type" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:51 America/New_York] PHP Warning: Undefined array key "blankpage_url" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:51 America/New_York] PHP Warning: Undefined array key "blankpage_image" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:50:51 America/New_York] PHP Warning: Undefined array key "blankpage_custom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:51:32 -0400]: <tak2le3u> PHP Error: Can use only one plugin for attachments/file uploads! Using 'database_attachments', ignoring others. in /var/www/roundcube/plugins/filesystem_attachments/filesystem_attachments.php on line 39 (POST /?_task=settings&_action=refresh) [01-Oct-2022 08:51:32 America/New_York] PHP Warning: Undefined array key "customise_blankpage" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 137 [01-Oct-2022 08:51:32 America/New_York] PHP Warning: Undefined array key "blankpage_type" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:51:32 America/New_York] PHP Warning: Undefined array key "blankpage_url" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:51:32 America/New_York] PHP Warning: Undefined array key "blankpage_image" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142 [01-Oct-2022 08:51:32 America/New_York] PHP Warning: Undefined array key "blankpage_custom" in /var/www/roundcube/plugins/toolbox/toolbox.php on line 142

Output from ../logs/toolbox.log:

When clicking Save in Customize: [01-Oct-2022 09:04:44 -0400]: <tak2le3u> ERROR in [storage].[sql].[function save_tool_data]: cannot insert into domain settings: [1292] Incorrect datetime value: 'now()' for columnroundcubemail.toolbox_customise_domains.modifiedat row 1 [01-Oct-2022 09:04:44 -0400]: <tak2le3u> ERROR in [function save]: data not stored

When clicking Ooo button: [01-Oct-2022 09:08:08 -0400]: <tak2le3u> ERROR in [storage].[sql].[function save_tool_data]: cannot execute query [INSERT INTO vacation (email, domain, active, activefrom, activeuntil, interval_time, subject, body, modified, created) VALUES ('someone@example.com','example.com',true,'2022-10-05 09:08:08','2022-10-29 09:08:08',0,'***** Out of Office *****','Some random message.',now(),now());] - [1364] Field 'cache' doesn't have a default value [01-Oct-2022 09:08:08 -0400]: <tak2le3u> ERROR in [function save]: data not stored

I'm not a programmer by any means, but I have fun tinkering when I can. I won't make any promises, but I'll also start trying to debug a little later. This should help give a more detailed view, or so I hope. ;-)

MikeWard0321 commented 2 years ago

UPDATE: Vacation/Out-of-Office auto-responder issue is fixed.

[01-Oct-2022 23:39:12 -0400]: <p80t235a> ERROR in [storage].[sql].[function save_tool_data]: cannot execute query [INSERT INTO vacation (email, domain, active, activefrom, activeuntil, interval_time, subject, body, modified, created) VALUES ('mike@example.com','example.com',true,'2022-10-13 23:39:12','2022-10-22 23:39:12',0,'***** Out of Office *****','Testing',now(),now());] - [1364] Field 'cache' doesn't have a default value [01-Oct-2022 23:39:12 -0400]: <p80t235a> ERROR in [function save]: data not stored

Simply changing the vacation table in my PostfixAdmin database for cache to have a default value of NULL seems to have done the trick.

Hopefully, I'll have a better answer for the Customize and Attachments issues in the coming days. ;-)

Screenshot_20221001_235337-1

gianlucagiacometti commented 1 year ago

There is a bug around line 644 since if multiple domains is true elements[1] is undefined. I'm going to fix everything next week.