summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorChristoph Erhardt <kolab@sicherha.de>2022-06-17 22:09:49 +0200
committerChristoph Erhardt <kolab@sicherha.de>2022-06-17 22:10:02 +0200
commitbdfb5bfca3e98deed3bcb7e3480b8602b1d9644d (patch)
treecad320d5ad140ba216e1e902f76d8b8a94baa1a3 /pykolab
parent015ece8de4369b40fe74d1f000999842f460f86c (diff)
downloadpykolab-bdfb5bfca3e98deed3bcb7e3480b8602b1d9644d.tar.gz
cli - direct dam implementation
Summary: This is an extended imaplib def deleteacl function def deleteacl(self, mailbox, who): """Delete the ACLs (remove any rights) set for who on mailbox. (typ, [data]) = <instance>.deleteacl(mailbox, who) """ return self._simple_command('DELETEACL', mailbox, who) This is more direct without sam workaround Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Subscribers: sicherha Differential Revision: https://git.kolab.org/D3572
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/cli/cmd_delete_mailbox_acl.py2
-rw-r--r--pykolab/imap/__init__.py12
2 files changed, 13 insertions, 1 deletions
diff --git a/pykolab/cli/cmd_delete_mailbox_acl.py b/pykolab/cli/cmd_delete_mailbox_acl.py
index 2a70115..e4c1d62 100644
--- a/pykolab/cli/cmd_delete_mailbox_acl.py
+++ b/pykolab/cli/cmd_delete_mailbox_acl.py
@@ -65,7 +65,7 @@ def execute(*args, **kw):
folders = imap.list_folders(folder)
for folder in folders:
try:
- imap.set_acl(folder, identifier, '')
+ imap.del_acl(folder, identifier)
except:
# Mailbox no longer exists?
pass
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index 171e4e5..a773bfc 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -435,6 +435,18 @@ class IMAP(object):
)
)
+ def del_acl(self, folder, identifier):
+ try:
+ self.imap.dam(self.folder_utf7(folder), identifier)
+ except Exception as errmsg:
+ log.error(
+ _("Could not delete ACL for %s on folder %s: %r") % (
+ identifier,
+ folder,
+ errmsg
+ )
+ )
+
def set_metadata(self, folder, metadata_path, metadata_value, shared=True):
"""
Set a metadata entry on a folder