1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-12-23 23:01:34 +00:00

[DockerApi] Fix IMAP ACL migration issue when renaming mailbox

This commit is contained in:
FreddleSpl0it
2024-10-31 11:00:03 +01:00
parent 2d76ffc88c
commit d8c8e4ab1b
2 changed files with 34 additions and 18 deletions

View File

@@ -3364,12 +3364,14 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
// set imap acls
foreach ($imap_acls as $imap_acl) {
$user_id = ($imap_acl['id'] == $old_username) ? $new_username : $imap_acl['id'];
$user = ($imap_acl['user'] == $old_username) ? $new_username : $imap_acl['user'];
$exec_fields = array(
'cmd' => 'doveadm',
'task' => 'set_acl',
'user' => $imap_acl['user'],
'user' => $user,
'mailbox' => $imap_acl['mailbox'],
'id' => $new_username,
'id' => $user_id,
'rights' => $imap_acl['rights']
);
docker('post', 'dovecot-mailcow', 'exec', $exec_fields);