From 7477f89a54af5b5fb10d1c46a9f81e88eb4d77df Mon Sep 17 00:00:00 2001 From: Martyn Alberts Date: Thu, 18 Jul 2019 12:57:55 +0200 Subject: [PATCH] Manage recipient: Display error when PR_EC_RECIPIENT_HISTORY_JSON_W does not exist --- manage_recipients/manage_recipients.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/manage_recipients/manage_recipients.py b/manage_recipients/manage_recipients.py index 862f90e..3f1b1df 100644 --- a/manage_recipients/manage_recipients.py +++ b/manage_recipients/manage_recipients.py @@ -2,8 +2,10 @@ #encoding: utf-8 import kopano +from kopano.errors import NotFoundError from MAPI.Util import * import json +import sys def opt_args(): @@ -28,7 +30,11 @@ def main(): sys.exit(0) 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) if options.backup: