diff --git a/src/Mailcow.php b/src/Mailcow.php index 79a033a..7205bc0 100644 --- a/src/Mailcow.php +++ b/src/Mailcow.php @@ -183,7 +183,43 @@ class Server_Manager_Mailcow extends Server_Manager ] ]; $result2 = $this->_makeRequest('POST', 'add/domain-admin', $domainAdminData); - if (! str_contains($result2, 'success')) { + if (str_contains($result2, 'success')) { + + + $domainAclData = [ + 'json' => [ + "items" => [ + "adm_" . str_replace(".", "", $a->getDomain()) + ], + "attr" => [ + "da_acl" => [ + "quarantine", + "login_as", + "sogo_access", + "app_passwds", + "bcc_maps", + "filters", + "spam_policy", + "protocol_access", + "smtp_ip_access", + ] + ] + ] + ]; + $result3 = $this->_makeRequest('POST', 'edit/da-acl', $domainAclData); + if (!str_contains($result3, 'success')) { + $placeholders = [':action:' => 'edit ACL', ':type:' => 'Mailcow']; + + throw new Server_Exception('Failed to :action: on the :type: server, check the error logs for further details', $placeholders); + + + } + + + + + } + else { $placeholders = [':action:' => __trans('create domain'), ':type:' => 'Mailcow']; throw new Server_Exception('Failed to :action: on the :type: server, check the error logs for further details', $placeholders);