From 187ddedf9614be78909c3cb73f413a1de74142fb Mon Sep 17 00:00:00 2001 From: jkellerer Date: Thu, 5 May 2022 19:43:33 +0200 Subject: [PATCH 1/6] Fix for /api/v1/get/mailbox/{email} --- data/web/json_api.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/data/web/json_api.php b/data/web/json_api.php index 8f0e1398e..b04314ca6 100644 --- a/data/web/json_api.php +++ b/data/web/json_api.php @@ -989,11 +989,15 @@ if (isset($_GET['query'])) { if (isset($_GET['tags']) && $_GET['tags'] != '') $tags = explode(',', $_GET['tags']); - $mailboxes = mailbox('get', 'mailboxes', $object, $tags); - if (!empty($mailboxes)) { - foreach ($mailboxes as $mailbox) { - if ($details = mailbox('get', 'mailbox_details', $mailbox)) $data[] = $details; - else continue; + if ($tags === null) { + $data = mailbox('get', 'mailbox_details', $object); + } else { + $mailboxes = mailbox('get', 'mailboxes', $object, $tags); + if (is_array($mailboxes)) { + foreach ($mailboxes as $mailbox) { + if ($details = mailbox('get', 'mailbox_details', $mailbox)) + $data[] = $details; + } } } process_get_return($data); From f4dc01d1ecd95d22f12b6fdf81b8676346e401c5 Mon Sep 17 00:00:00 2001 From: jkellerer Date: Thu, 5 May 2022 20:00:40 +0200 Subject: [PATCH 2/6] Ensure return type is consistent (list vs object) --- data/web/json_api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/web/json_api.php b/data/web/json_api.php index b04314ca6..8db4ef899 100644 --- a/data/web/json_api.php +++ b/data/web/json_api.php @@ -991,6 +991,7 @@ if (isset($_GET['query'])) { if ($tags === null) { $data = mailbox('get', 'mailbox_details', $object); + process_get_return($data); } else { $mailboxes = mailbox('get', 'mailboxes', $object, $tags); if (is_array($mailboxes)) { @@ -999,8 +1000,8 @@ if (isset($_GET['query'])) { $data[] = $details; } } + process_get_return($data, false); } - process_get_return($data); break; } break; From f40e682800f72c034d4c3698c9984ab006913910 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Fri, 6 May 2022 07:42:45 +0200 Subject: [PATCH 3/6] [Web] domain/mailbox tagging check for empty tags --- data/web/inc/functions.mailbox.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index f619f05dd..1c6e5b40d 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -568,6 +568,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { )); // save tags foreach($tags as $index => $tag){ + if (empty($tag)) continue; if ($index > $GLOBALS['TAGGING_LIMIT']) { $_SESSION['return'][] = array( 'type' => 'warning', @@ -1124,6 +1125,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { )); // save tags foreach($tags as $index => $tag){ + if (empty($tag)) continue; if ($index > $GLOBALS['TAGGING_LIMIT']) { $_SESSION['return'][] = array( 'type' => 'warning', @@ -2201,8 +2203,9 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ':gal' => $gal, ':domain' => $domain )); - // save tags, tag_name is unique + // save tags foreach($tags as $index => $tag){ + if (empty($tag)) continue; if ($index > $GLOBALS['TAGGING_LIMIT']) { $_SESSION['return'][] = array( 'type' => 'warning', @@ -2368,8 +2371,9 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { ':description' => $description, ':domain' => $domain )); - // save tags, tag_name is unique + // save tags foreach($tags as $index => $tag){ + if (empty($tag)) continue; if ($index > $GLOBALS['TAGGING_LIMIT']) { $_SESSION['return'][] = array( 'type' => 'warning', @@ -2712,6 +2716,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) { )); // save tags foreach($tags as $index => $tag){ + if (empty($tag)) continue; if ($index > $GLOBALS['TAGGING_LIMIT']) { $_SESSION['return'][] = array( 'type' => 'warning', From dfdd2dadb4e498325efbd123cf4e8aac378dadb6 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Fri, 6 May 2022 08:30:15 +0200 Subject: [PATCH 4/6] [Web] domain/mailbox tagging check for empty tags --- data/web/js/build/014-mailcow.js | 1 + 1 file changed, 1 insertion(+) diff --git a/data/web/js/build/014-mailcow.js b/data/web/js/build/014-mailcow.js index bf7e78b11..dc550bb98 100644 --- a/data/web/js/build/014-mailcow.js +++ b/data/web/js/build/014-mailcow.js @@ -290,6 +290,7 @@ $(document).ready(function() { var tagValuesElem = $(tagboxElem).find(".tag-values")[0]; var tag = escapeHtml($(tagInputElem).val()); + if (!tag) return; var value_tags = []; try { value_tags = JSON.parse($(tagValuesElem).val()); From 96b8054e6b3e88fb85c6d44f89158216c9f0ea38 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Fri, 6 May 2022 08:52:44 +0200 Subject: [PATCH 5/6] [Web] change opacity of footable collapse toggle --- data/web/css/build/008-mailcow.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data/web/css/build/008-mailcow.css b/data/web/css/build/008-mailcow.css index 75b96840e..c8c21b183 100644 --- a/data/web/css/build/008-mailcow.css +++ b/data/web/css/build/008-mailcow.css @@ -232,6 +232,9 @@ table.footable>tbody>tr.footable-empty>td { font-style:italic; font-size: 1rem; } +table>tbody>tr>td>span.footable-toggle { + opacity: 0.75; +} .navbar-nav > li { font-size: 1rem !important; } @@ -292,4 +295,5 @@ code { padding: 0 5px 0 5px; align-items: center; display: inline-flex; -} \ No newline at end of file +} + From 5839e227969c08dd2f78aa92ae31ee340faeba6a Mon Sep 17 00:00:00 2001 From: Peter Date: Tue, 10 May 2022 21:14:51 +0200 Subject: [PATCH 6/6] Update issue template --- .github/ISSUE_TEMPLATE/Bug_report.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.yml b/.github/ISSUE_TEMPLATE/Bug_report.yml index fee623bee..6134a9adb 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.yml +++ b/.github/ISSUE_TEMPLATE/Bug_report.yml @@ -54,10 +54,11 @@ body: | --- | --- | | My operating system | I_DO_REPLY_HERE | | Is Apparmor, SELinux or similar active? | I_DO_REPLY_HERE | - | Virtualization technlogy (KVM, VMware, Xen, etc - **LXC and OpenVZ are not supported** | I_DO_REPLY_HERE | + | Virtualization technology (KVM, VMware, Xen, etc - **LXC and OpenVZ are not supported** | I_DO_REPLY_HERE | | Server/VM specifications (Memory, CPU Cores) | I_DO_REPLY_HERE | - | Docker Version (`docker version`) | I_DO_REPLY_HERE | - | Docker-Compose Version (`docker-compose version`) | I_DO_REPLY_HERE | + | Docker version (`docker version`) | I_DO_REPLY_HERE | + | docker-compose version (`docker-compose version`) | I_DO_REPLY_HERE | + | mailcow version (```git describe --tags `git rev-list --tags --max-count=1` ```) | I_DO_REPLY_HERE | | Reverse proxy (custom solution) | I_DO_REPLY_HERE | Output of `git diff origin/master`, any other changes to the code? If so, **please post them**: