Created
April 16, 2018 07:23
-
-
Save bkram/9fa505d79d89b2e38769abf2e5494502 to your computer and use it in GitHub Desktop.
Kopano-fix-ipm-subtree, from KC 8.5.5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 | |
# | |
import sys | |
import kopano | |
from MAPI.Tags import PR_IPM_SUBTREE_ENTRYID | |
server = kopano.Server(auth_user='SYSTEM', auth_pass='') | |
if not len(server.options.users): | |
sys.exit('Usage: %s -u username' % sys.argv[0]) | |
user = kopano.User(server.options.users[0]) | |
if user.store.subtree: | |
sys.exit() | |
subtree = user.store.root.folder('IPM_SUBTREE') | |
if not subtree: | |
sys.exit("Result: IPM_SUBTREE folder not found") | |
print('Result: FIXED - Setting PR_IPM_SUBTREE_ENTRYID to IPM_SUBTREE') | |
print('PR_IPM_SUBTREE_ENTRYID current value: ' + user.store.prop(PR_IPM_SUBTREE_ENTRYID).strval) | |
user.store.prop(PR_IPM_SUBTREE_ENTRYID).value = subtree.entryid.decode('hex') | |
print('PR_IPM_SUBTREE_ENTRYID set to: ' + subtree.entryid) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment