Manage recipient: Display error when PR_EC_RECIPIENT_HISTORY_JSON_W does not exist
This commit is contained in:
parent
7b4845a877
commit
7477f89a54
@ -2,8 +2,10 @@
|
|||||||
#encoding: utf-8
|
#encoding: utf-8
|
||||||
|
|
||||||
import kopano
|
import kopano
|
||||||
|
from kopano.errors import NotFoundError
|
||||||
from MAPI.Util import *
|
from MAPI.Util import *
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def opt_args():
|
def opt_args():
|
||||||
@ -28,7 +30,11 @@ def main():
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
user = kopano.Server(options).user(options.user)
|
user = kopano.Server(options).user(options.user)
|
||||||
webapp = user.store.prop(0X6773001F).value
|
try:
|
||||||
|
webapp = user.store.prop(0X6773001F).value
|
||||||
|
except NotFoundError:
|
||||||
|
print('Property PR_EC_RECIPIENT_HISTORY_JSON_W not found. User might have never used recipient history before.', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
webapp = json.loads(webapp)
|
webapp = json.loads(webapp)
|
||||||
|
|
||||||
if options.backup:
|
if options.backup:
|
||||||
|
Loading…
Reference in New Issue
Block a user