Internal cyrus formats wrapper was just implemented
[imap-restore-mail] / src / imap_restore_mail.py
index e681ec0..a6390e3 100644 (file)
@@ -72,13 +72,7 @@ def update_mailboxes(storage, session, args):
     # add acls after all subfolders or their acls will be derived from parent folder
     for acl_mailbox in storage.acl_mailboxes:
         # find folder acls record and retrieve them
-        try:
-            mb_acls = storage.file_acls[acl_mailbox]
-        except KeyError:
-            # no rights for the mailbox were found and warn if acl file loaded
-            if len(storage.file_acls) > 0:
-                logging.warning("Could not find the acls for mailbox %s for user %s.", acl_mailbox, args.ouser)
-            mb_acls = {}
+        mb_acls = storage.get_mailbox_acls(acl_mailbox)
         session.add_acls(acl_mailbox, mb_acls, args.ouser, args.user)
     storage.created_mailboxes = []
     storage.acl_mailboxes = []