This code is designed to perform a cleanup after a mailbox rehydration (from Symantec Enterprise Vault). We take a snapshot index of the MessageId and ConversationId of all items in the mailbox before the rehydration.
After the rehydration this code
if (string.Equals(item.ItemClass, "IPM.Note.EnterpriseVault.Shortcut", StringComparison.InvariantCulture) || ((existingIds.Any(x => x.ConversationId == item.ConversationId.ToString()) == false || (item.ItemClass == "IPM.Appointment" && existingIds.Any(x => x.MessageId == item.Id.ToString()) == false) && item.DateTimeReceived < snapshotDate)))
{
item.Delete(DeleteMode.HardDelete);
}
should delete
- Any items which have an
ItemClassof "IPM.Note.EnterpriseVault.Shortcut" - Any items which have an
ItemClassof "IPM.Appointment" where theIdis not in theexistingIdslist ofMessageIds, unless they were received after the `snapshotDate - Any other items where the
ConversationIdis not in theexistingIdslist, unless they were received after thesnapshotDate.
After running this code a user reported having lost some email that was received after the snapshotDate so it seems I have got the if statement wrong! :( Could somebody tell me please what I have got wrong (or a way that I can break this down to understand it better) and what this code will actually have done so I can let the user know what has been lost. I know lofical ORs are notoriously hard to get write and I think I have made a mistake with the brackets somewhere but I just can't see it.
Aucun commentaire:
Enregistrer un commentaire