Closed hamarituc closed 6 months ago
I'm pretty sure we've always tried to access the root folder before accessing the calendar. Unfortunately, I don't have access to a multi-account test setup, so I'm not able to reproduce this myself. Your best bet is to enable debug logging and comparing the XML requests and responses of a working and a non-working version of exchangelib. That would reveal what version 5.2 does differently.
Attached you will find the log comparing the working version (5.0.3) and the failing version (5.1.0). I am wondering why the newer version connects with Exchange 2016 API version, wheres the older one connects with Exchange 2019 version. The server is Exchange 2019. Maybe this is the root cause of the issue?
It's possible that this was fixed by https://github.com/ecederstrand/exchangelib/commit/f65079f372a35d09a3d4b3e929ecc53bd60b6fc1. Can you test it out?
It's possible that this was fixed by f65079f. Can you test it out?
I tested the commit. The Exception is now gone, but the search returns an empty result set. Attached you will find the logs
... and the XML requests and responses I extracted from it.
I think the error happens when querying the calendar folder, as the t:Mailbox
-Entity is missing.
--- working-req4.txt 2024-04-19 09:18:14.404610015 +0200
+++ failing-req3.txt 2024-04-19 09:09:02.180618517 +0200
@@ -13,13 +13,7 @@
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="100" Offset="0" BasePoint="Beginning"/>
<m:ParentFolderIds>
- <t:DistinguishedFolderId Id="calendar">
- <t:Mailbox>
- <t:EmailAddress>mail@server.domain</t:EmailAddress>
- <t:RoutingType>SMTP</t:RoutingType>
- <t:MailboxType>Mailbox</t:MailboxType>
- </t:Mailbox>
- </t:DistinguishedFolderId>
+ <t:DistinguishedFolderId Id="calendar"/>
</m:ParentFolderIds>
</m:FindItem>
</s:Body>
Thanks for the helpful debug output!
This may have been fixed by https://github.com/ecederstrand/exchangelib/commit/d9035d03960797f9277381845e4ec98f837798ea
Describe the bug
Accessing a shared calendar is not possible if the accessing account has access permissions to the calendar only, but not to the root folder of the target mailbox.
To Reproduce
mail@domain
username
to the calendar folderExpected behavior
The calendar items should be returned,
Log output
Additional context
The code tries to access the root folder of the shared mailbox which should not be necessary. It worked in version 5.0. There was a bug in version 5.1 which resulted in routing the access to the mailbox of the accessing user instead of the shared mailbox (#1222). It doesn't work in 5.2. Thus i cannot determine if the bug was introduced between 5.0 and 5.1 or between 5.1 and 5.2.