diff --git a/OpenChange/MAPIStoreFolder.m b/OpenChange/MAPIStoreFolder.m index 644f88965..15f3ca431 100644 --- a/OpenChange/MAPIStoreFolder.m +++ b/OpenChange/MAPIStoreFolder.m @@ -29,6 +29,7 @@ #import #import #import +#import #import #import #import @@ -235,6 +236,11 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe if ([[self folderKeys] containsObject: folderKey]) { woContext = [[self userContext] woContext]; + /* We activate the user for the context using the root folder + context as there are times where the active user is not + matching with the one stored in the application context + and SOGo object is storing cached data with the wrong user */ + [[self userContext] activateWithUser: [woContext activeUser]]; sogoFolder = [sogoObject lookupName: folderKey inContext: woContext acquire: NO]; if (sogoFolder && ![sogoFolder isKindOfClass: NSExceptionK])