Commit 33b0eb2f authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1196 Catch MAPI_E_INVALID_PARAMETER when a group can not be opened

from the addressbook.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 9e4f0a3e
...@@ -371,7 +371,12 @@ class Kopano extends SyncWorker { ...@@ -371,7 +371,12 @@ class Kopano extends SyncWorker {
// is this a group? // is this a group?
if (array_key_exists($entry[PR_ACCOUNT], $groups)) { if (array_key_exists($entry[PR_ACCOUNT], $groups)) {
$a->type = GABEntry::GROUP; $a->type = GABEntry::GROUP;
$groupentry = mapi_ab_openentry($addrbook, $entry[PR_ENTRYID]); $groupentry = @mapi_ab_openentry($addrbook, $entry[PR_ENTRYID]);
// some groups can not be opened - ZP-1196
if (mapi_last_hresult() == MAPI_E_INVALID_PARAMETER) {
$this->Log(sprintf("Kopano->GetGAB(): Ignoring group '%s' as it can not be opened.\n", $entry[PR_ACCOUNT]));
continue;
}
$grouptable = mapi_folder_getcontentstable($groupentry, MAPI_DEFERRED_ERRORS); $grouptable = mapi_folder_getcontentstable($groupentry, MAPI_DEFERRED_ERRORS);
$users = mapi_table_queryallrows($grouptable, array(PR_ENTRYID, PR_ACCOUNT, PR_SMTP_ADDRESS)); $users = mapi_table_queryallrows($grouptable, array(PR_ENTRYID, PR_ACCOUNT, PR_SMTP_ADDRESS));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment