update_mailboxes(storage, session, args)
logging.info("Finished injecting mails. Exiting with code %s.", warnings_handler.detected_problems)
- return warnings_handler.detected_problems
+ return int(warnings_handler.detected_problems > 0)
def update_mailboxes(storage, session, args):
"""Create new mailboxes if necessary and add acls to mailboxes if necessary."""
# 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
- mb_acls = storage.get_mailbox_acls(acl_mailbox)
+ mb_acls = storage.get_mailbox_acls(acl_mailbox, args.ouser)
session.add_acls(acl_mailbox, mb_acls, args.ouser, args.user)
storage.created_mailboxes = []
storage.acl_mailboxes = []