Issue: I am experiencing a recurring System.InvalidCastException during the synchronization of the “All Mail” folder. The error log specifies: Unable to cast object of type 'System.Int32' to type 'System.Int64' at MailClient.Protocols.Common.ItemSynchronizeContext.StoreItems.
Steps taken to resolve (without success):
Deleted the email account and re-added it.
Performed a clean installation by deleting the %AppData%\eM Client folder.
Used the /DbRepair tool.
The error appears immediately after a fresh setup as soon as the IMAP synchronization starts downloading headers/items from the “All Mail” folder. It seems to be a regression in how the client handles Large UIDs or metadata from Gmail’s IMAP server in this specific build.
Error Log Snippet:
[IMAP] System.InvalidCastException: Unable to cast object of type 'System.Int32' to type 'System.Int64'.
at MailClient.Protocols.Common.ItemSynchronizeContext`2.StoreItems[TUid,TVid](SynchronizationType synchronizationType, IEnumerable`1 newItems, Dictionary`2 uniqueIdToVersionId, Dictionary`2 uniqueIdToOid)
at MailClient.Protocols.Common.MailItemSynchronizeContext.StoreItems[TUid,TVid](SynchronizationType synchronizationType, IEnumerable`1 newItems, Dictionary`2 uniqueIdToVersionId, Dictionary`2 uniqueIdToOid)
Please let me know if you need further logs or if there is a hotfix available for this data type mismatch.
I have the same issue on one of my three IMAP accounts since some days. Today I’ve updated to version 10.4.4867, the problem is still there.
Please keep me informed as well.
Thanks.
Update: I tried some things with my webmail access and I recognized that the ‘deleted’ folder had a lot of messages. So I purged them all manually. And now after purging, the synchronization in eM client works again.