Skip to content

Commit

Permalink
Only allow values on the DistinguishedFolderId field if we recognize …
Browse files Browse the repository at this point in the history
…the ID. Refs #1301
  • Loading branch information
Erik Cederstrand committed May 13, 2024
1 parent 138697e commit 1e77961
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions exchangelib/services/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -979,4 +979,8 @@ def parse_folder_elem(elem, folder):
# Not all servers support fetching the DistinguishedFolderId field. Add it back here.
if folder._distinguished_id and not res._distinguished_id:
res._distinguished_id = folder._distinguished_id
# Some servers return folders in a FindFolder result that have a DistinguishedFolderId element that the same server
# cannot handle in a GetFolder request. Only set the DistinguishedFolderId field if we recognize the ID.
elif res._distinguished_id and not folder.DISTINGUISHED_FOLDER_ID:
res._distinguished_id = None
return res

0 comments on commit 1e77961

Please sign in to comment.