diff --git a/data/web/json_api.php b/data/web/json_api.php index 66e9f22e..161a1b0c 100644 --- a/data/web/json_api.php +++ b/data/web/json_api.php @@ -601,7 +601,12 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u case "mailbox": switch ($object) { case "all": - $domains = mailbox('get', 'domains'); + if(empty($extra)) { + $domains = mailbox('get', 'domains'); + } + else { + $domains = [ $extra ]; + } if (!empty($domains)) { foreach ($domains as $domain) { $mailboxes = mailbox('get', 'mailboxes', $domain); @@ -940,7 +945,12 @@ if (isset($_SESSION['mailcow_cc_role']) || isset($_SESSION['pending_mailcow_cc_u case "alias": switch ($object) { case "all": - $domains = array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains')); + if(empty($extra)) { + $domains = array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains')); + } + else { + $domains = [ $extra ]; + } if (!empty($domains)) { foreach ($domains as $domain) { $aliases = mailbox('get', 'aliases', $domain);