// Token: 0x060003D3 RID: 979 RVA: 0x0001B870 File Offset: 0x00019A70 private void EvaluateAndEnlistItem(object[] itemProperties, PropertyIndexHolder propertyIndexHolder) { string text; if (!this.PreScreenPassed(itemProperties, propertyIndexHolder, out text)) { return; } ContentSetting retentionEnabledSettingForTag = ((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetRetentionEnabledSettingForTag(((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).DefaultArchiveAdTag, text); if (retentionEnabledSettingForTag == null) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Could not find a default archive Content Setting for this item. Skipping it.", this); return; } Dictionary <Guid, AdTagData> allTags = ((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetAllTags(); Dictionary <Guid, string> dictionary = new Dictionary <Guid, string>(); foreach (KeyValuePair <Guid, AdTagData> keyValuePair in allTags) { dictionary.Add(keyValuePair.Key, keyValuePair.Value.Tag.Name); } if (ExpirationTagEnforcer.IsTimeToDie(itemProperties, retentionEnabledSettingForTag.AgeLimitForRetention.Value, text, propertyIndexHolder, base.MailboxDataForTags.MailboxSession, this.GetHashCode(), this.ToString(), ExpirationTagEnforcer.Tracer, base.MailboxDataForTags.UtcNow)) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer, string>((long)this.GetHashCode(), "{0}: Item of class {1} is old enough to die. Sniff.", this, text); this.tagExpirationExecutor.AddToReportAndDoomedList(itemProperties, propertyIndexHolder, retentionEnabledSettingForTag, dictionary, ItemData.EnforcerType.ExpirationTagEnforcer, false); this.numberItemsMovedByDefault++; } }
// Token: 0x060003D4 RID: 980 RVA: 0x0001B9C0 File Offset: 0x00019BC0 private bool PreScreenPassed(object[] itemProperties, PropertyIndexHolder propertyIndexHolder, out string itemClass) { itemClass = null; VersionedId versionedId = itemProperties[propertyIndexHolder.IdIndex] as VersionedId; if (versionedId == null) { ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: We could not get id of this item. Skipping it.", this); return(false); } StoreObjectId storeObjectId = itemProperties[propertyIndexHolder.ParentItemIdIndex] as StoreObjectId; if (storeObjectId == null) { ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: We could not get parent id of this item. Skipping it.", this); return(false); } if (base.MailboxDataForTags.CorruptItemList.Contains(versionedId.ObjectId)) { ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer, VersionedId>((long)this.GetHashCode(), "{0}: The item {1} is in the corrupt list. Skipping it.", this, versionedId); return(false); } itemClass = (itemProperties[propertyIndexHolder.ItemClassIndex] as string); itemClass = ((itemClass == null) ? string.Empty : itemClass.ToLower(CultureInfo.InvariantCulture)); return(TagAssistantHelper.IsRetainableItem(itemClass) && (!TagAssistantHelper.IsConflictableItem(itemClass, storeObjectId.ProviderLevelItemId, this.deletedItemsId) || base.ElcTagSubAssistant.ELCAssistantCalendarTaskRetentionEnabled)); }
// Token: 0x060003CF RID: 975 RVA: 0x0001B13C File Offset: 0x0001933C private void CollectItemsMarkedForExpiration(MailboxSession session) { base.Assistant.ThrowIfShuttingDown(base.MailboxDataForTags.MailboxSession.MailboxOwner); ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: About to collect items for expiration.", this); PropertyIndexHolder propertyIndexHolder = new PropertyIndexHolder(ExpirationTagEnforcer.ItemDataColumns); AllItemsFolderHelper.RunQueryOnAllItemsFolder <bool>(session, AllItemsFolderHelper.SupportedSortBy.RetentionDate, delegate(QueryResult queryResults) { ComparisonFilter seekFilter = new ComparisonFilter(ComparisonOperator.LessThanOrEqual, ItemSchema.RetentionDate, this.MailboxDataForTags.UtcNow.Date); if (queryResults.SeekToCondition(SeekReference.OriginBeginning, seekFilter)) { bool flag = false; while (!flag) { object[][] rows = queryResults.GetRows(100); ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer, int>((long)this.GetHashCode(), "{0}: GetRows returned {1} items.", this, rows.Length); if (rows.Length <= 0) { break; } foreach (object[] array2 in rows) { if (array2[propertyIndexHolder.RetentionDateIndex] == null || array2[propertyIndexHolder.RetentionDateIndex] is PropertyError) { flag = true; break; } this.EnlistItem(array2, propertyIndexHolder.PolicyTagIndex, propertyIndexHolder.RetentionDateIndex, propertyIndexHolder); } this.Assistant.ThrottleStoreCallAndCheckForShutdown(this.MailboxDataForTags.MailboxSession.MailboxOwner); } } return(true); }, ExpirationTagEnforcer.ItemDataColumns); }
// Token: 0x060003CD RID: 973 RVA: 0x0001AECC File Offset: 0x000190CC private bool MigratedMessageQueryProcessor(QueryResult queryResults) { PropertyIndexHolder propertyIndexHolder = new PropertyIndexHolder(ExpirationTagEnforcer.ItemDataColumnsWithHoldExpirationDate); ComparisonFilter seekFilter = new ComparisonFilter(ComparisonOperator.LessThanOrEqual, ItemSchema.EHAMigrationExpiryDate, base.MailboxDataForTags.UtcNow.Date); if (queryResults.SeekToCondition(SeekReference.OriginBeginning, seekFilter)) { bool flag = false; while (!flag) { object[][] rows = queryResults.GetRows(100); ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer, int>((long)this.GetHashCode(), "{0}: GetRows returned {1} items.", this, rows.Length); if (rows.Length <= 0) { break; } foreach (object[] array2 in rows) { if (array2[propertyIndexHolder.EHAMigrationExpiryDateIndex] == null || array2[propertyIndexHolder.EHAMigrationExpiryDateIndex] is PropertyError) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: All items from here onwards would be null hence skipping all the rest.", this); flag = true; break; } this.EnlistItem(array2, propertyIndexHolder); } base.Assistant.ThrottleStoreCallAndCheckForShutdown(base.MailboxDataForTags.MailboxSession.MailboxOwner); } } return(true); }
// Token: 0x0600068D RID: 1677 RVA: 0x00032050 File Offset: 0x00030250 private bool MigratedMessageQueryProcessor(QueryResult queryResults) { PropertyIndexHolder propertyIndexHolder = new PropertyIndexHolder(EHAMigratedMessageMoveEnforcer.ItemDataColumnsWithHoldExpirationDate); queryResults.SeekToOffset(SeekReference.OriginBeginning, 0); bool flag = false; while (!flag) { object[][] rows = queryResults.GetRows(100); EHAMigratedMessageMoveEnforcer.Tracer.TraceDebug <EHAMigratedMessageMoveEnforcer, int>((long)this.GetHashCode(), "{0}: GetRows returned {1} items.", this, rows.Length); if (rows.Length <= 0) { break; } foreach (object[] array2 in rows) { if (array2[propertyIndexHolder.EHAMigrationExpiryDateIndex] == null || array2[propertyIndexHolder.EHAMigrationExpiryDateIndex] is PropertyError) { EHAMigratedMessageMoveEnforcer.Tracer.TraceDebug <EHAMigratedMessageMoveEnforcer>((long)this.GetHashCode(), "{0}: All items from here onwards would be null hence skipping all the rest.", this); flag = true; break; } this.EnlistItem(array2, propertyIndexHolder); } base.SysCleanupSubAssistant.ThrottleStoreCallAndCheckForShutdown(base.MailboxDataForTags.MailboxSession.MailboxOwner); } return(true); }
// Token: 0x0600028D RID: 653 RVA: 0x0000EFFA File Offset: 0x0000D1FA internal ItemStartDateCalculator(PropertyIndexHolder propertyIndexHolder, string folderDisplayName, DefaultFolderType folderType, MailboxSession mailboxSession, Trace tracer) { this.propertyIndexHolder = propertyIndexHolder; this.folderDisplayName = folderDisplayName; this.folderType = folderType; this.mailboxSession = mailboxSession; this.tracer = tracer; }
// Token: 0x060003CE RID: 974 RVA: 0x0001AFC4 File Offset: 0x000191C4 private void EnlistItem(object[] itemProperties, PropertyIndexHolder propertyIndexHolder) { string text; if (!this.PreScreenPassed(itemProperties, propertyIndexHolder, out text)) { return; } ItemData itemData = new ItemData((VersionedId)itemProperties[propertyIndexHolder.IdIndex], (int)itemProperties[propertyIndexHolder.SizeIndex]); this.tagExpirationExecutor.AddToDoomedHardDeleteList(itemData, false); this.numberItemsDeletedDueToMigrationExpiryDate++; }
// Token: 0x0600068E RID: 1678 RVA: 0x0003211C File Offset: 0x0003031C private void EnlistItem(object[] itemProperties, PropertyIndexHolder propertyIndexHolder) { string text; if (!this.PreScreenPassed(itemProperties, propertyIndexHolder, out text)) { return; } ItemData itemData = new ItemData((VersionedId)itemProperties[propertyIndexHolder.IdIndex], (StoreObjectId)itemProperties[propertyIndexHolder.ParentItemIdIndex], (int)itemProperties[propertyIndexHolder.SizeIndex]); base.TagExpirationExecutor.AddToDoomedMoveToMigratedMessagesList(itemData); this.itemsMovedToMigratedMessagesFolder++; }
// Token: 0x06000319 RID: 793 RVA: 0x00013E08 File Offset: 0x00012008 internal ItemAuditLogData(object[] row, PropertyIndexHolder propertyIndexHolder, FolderAuditLogData folderAuditLogData) { if (propertyIndexHolder.MessageSubjectIndex >= 0) { this.messageSubject = (row[propertyIndexHolder.MessageSubjectIndex] as string); } this.messageSender = (row[propertyIndexHolder.MessageSenderIndex] as string); string text = row[propertyIndexHolder.MessageSentRepresentingIndex] as string; if (!string.IsNullOrEmpty(text) && !text.Equals(this.messageSender, StringComparison.InvariantCultureIgnoreCase)) { this.messageSender = this.messageSender + " sent on behalf of " + text; } this.messageInternetId = (row[propertyIndexHolder.MessageInternetIdIndex] as string); this.messageClass = (row[propertyIndexHolder.ItemClassIndex] as string); this.folderAuditLogData = folderAuditLogData; }
// Token: 0x060003D1 RID: 977 RVA: 0x0001B3D8 File Offset: 0x000195D8 private void CollectItemsToMoveByDefault(MailboxSession session) { if (base.MailboxDataForTags.ElcUserTagInformation.MinDefaultMovePeriod == null) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: MinDefaultMovePeriod is null. No move to archive default tag found.", this); return; } ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer, EnhancedTimeSpan>((long)this.GetHashCode(), "{0}: MinDefaultMovePeriod is {1}. About to collect items to move based on default archive tag.", this, base.MailboxDataForTags.ElcUserTagInformation.MinDefaultMovePeriod.Value); PropertyIndexHolder propertyIndexHolder = new PropertyIndexHolder(ExpirationTagEnforcer.DefaultMoveQueryColumns); base.Assistant.ThrowIfShuttingDown(base.MailboxDataForTags.MailboxSession.MailboxOwner); using (Folder noArchiveTagSearchFolder = new SearchFolderManager(base.MailboxDataForTags.MailboxSession).GetNoArchiveTagSearchFolder()) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer, int>((long)this.GetHashCode(), "{0}: Created the noArchiveTagSearchFolder. Item count: {1}", this, noArchiveTagSearchFolder.ItemCount); if (noArchiveTagSearchFolder.ItemCount <= 0) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: The search folder is empty. There are no items without an archive tag. Quit.", this); } else { using (QueryResult queryResult = noArchiveTagSearchFolder.ItemQuery(ItemQueryType.None, null, new SortBy[] { new SortBy(ItemSchema.ReceivedTime, SortOrder.Descending) }, ExpirationTagEnforcer.DefaultMoveQueryColumns)) { ComparisonFilter seekFilter = new ComparisonFilter(ComparisonOperator.LessThanOrEqual, ItemSchema.ReceivedTime, base.MailboxDataForTags.UtcNow.Subtract(base.MailboxDataForTags.ElcUserTagInformation.MinDefaultMovePeriod.Value)); if (queryResult.SeekToCondition(SeekReference.OriginBeginning, seekFilter)) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Found at least one item that satifies the age and archive tag criteria.", this); foreach (object[] array in queryResult.Enumerator(100)) { if (array[propertyIndexHolder.RetentionDateIndex] != null && array[propertyIndexHolder.RetentionDateIndex] is ExDateTime && ((ExDateTime)array[propertyIndexHolder.RetentionDateIndex]).UniversalTime < base.MailboxDataForTags.UtcNow.Date) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Both retention date and archive date of the item have passed. Then the retention date wins. Skip adding the item to MTA list", this); } else { this.EvaluateAndEnlistItem(array, propertyIndexHolder); } } } } base.Assistant.ThrottleStoreCallAndCheckForShutdown(base.MailboxDataForTags.MailboxSession.MailboxOwner); } } }
// Token: 0x060003D0 RID: 976 RVA: 0x0001B360 File Offset: 0x00019560 private void CollectItemsMarkedForMove(MailboxSession session) { base.Assistant.ThrowIfShuttingDown(base.MailboxDataForTags.MailboxSession.MailboxOwner); ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: About to collect items marked for move via archive tag.", this); PropertyIndexHolder propertyIndexHolder = new PropertyIndexHolder(ExpirationTagEnforcer.ItemDataColumns); AllItemsFolderHelper.RunQueryOnAllItemsFolder <bool>(session, AllItemsFolderHelper.SupportedSortBy.ArchiveDate, delegate(QueryResult queryResults) { ComparisonFilter seekFilter = new ComparisonFilter(ComparisonOperator.LessThanOrEqual, ItemSchema.ArchiveDate, this.MailboxDataForTags.UtcNow.Date); if (queryResults.SeekToCondition(SeekReference.OriginBeginning, seekFilter)) { bool flag = false; while (!flag) { object[][] rows = queryResults.GetRows(100); ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer, int>((long)this.GetHashCode(), "{0}: GetRows returned {1} items.", this, rows.Length); if (rows.Length <= 0) { break; } foreach (object[] array2 in rows) { if (array2[propertyIndexHolder.ArchiveDateIndex] == null || array2[propertyIndexHolder.ArchiveDateIndex] is PropertyError) { flag = true; break; } if (array2[propertyIndexHolder.RetentionDateIndex] != null && array2[propertyIndexHolder.RetentionDateIndex] is ExDateTime && ((ExDateTime)array2[propertyIndexHolder.RetentionDateIndex]).UniversalTime < this.MailboxDataForTags.UtcNow.Date) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Both retention date and archive date of the item have passed. Then the retention date wins. Skip adding the item to MTA list", this); } else { this.EnlistItem(array2, propertyIndexHolder.ArchiveTagIndex, propertyIndexHolder.ArchiveDateIndex, propertyIndexHolder); } } this.Assistant.ThrottleStoreCallAndCheckForShutdown(this.MailboxDataForTags.MailboxSession.MailboxOwner); } } return(true); }, ExpirationTagEnforcer.ItemDataColumns); }
// Token: 0x0600068F RID: 1679 RVA: 0x00032180 File Offset: 0x00030380 private bool PreScreenPassed(object[] itemProperties, PropertyIndexHolder propertyIndexHolder, out string itemClass) { itemClass = null; VersionedId versionedId = itemProperties[propertyIndexHolder.IdIndex] as VersionedId; if (versionedId == null) { EHAMigratedMessageMoveEnforcer.Tracer.TraceError <EHAMigratedMessageMoveEnforcer>((long)this.GetHashCode(), "{0}: We could not get id of this item. Skipping it.", this); return(false); } if (!(itemProperties[propertyIndexHolder.ParentItemIdIndex] is StoreObjectId)) { EHAMigratedMessageMoveEnforcer.Tracer.TraceError <EHAMigratedMessageMoveEnforcer>((long)this.GetHashCode(), "{0}: We could not get parent id of this item. Skipping it.", this); return(false); } if (base.MailboxDataForTags.CorruptItemList.Contains(versionedId.ObjectId)) { EHAMigratedMessageMoveEnforcer.Tracer.TraceError <EHAMigratedMessageMoveEnforcer, VersionedId>((long)this.GetHashCode(), "{0}: The item {1} is in the corrupt list. Skipping it.", this, versionedId); return(false); } itemClass = (itemProperties[propertyIndexHolder.ItemClassIndex] as string); itemClass = ((itemClass == null) ? string.Empty : itemClass.ToLower(CultureInfo.InvariantCulture)); return(true); }
// Token: 0x060001C6 RID: 454 RVA: 0x0000C260 File Offset: 0x0000A460 internal void AddToReportAndDoomedList(object[] itemProperties, PropertyIndexHolder propertyIndexHolder, ContentSetting settings, Dictionary <Guid, string> allPolicyTags, ItemData.EnforcerType enforcerType, bool disableCalendarLogging) { this.AddToReport(settings.RetentionAction, itemProperties, propertyIndexHolder, allPolicyTags); this.AddToDoomedList(new ItemData((VersionedId)itemProperties[propertyIndexHolder.IdIndex], (StoreObjectId)itemProperties[propertyIndexHolder.ParentItemIdIndex], enforcerType, (int)itemProperties[propertyIndexHolder.SizeIndex]), settings, disableCalendarLogging); }
// Token: 0x060002FD RID: 765 internal abstract void Invoke(ProvisionedFolder provisionedFolder, List <object[]> items, PropertyIndexHolder propertyIndexHolder);
// Token: 0x060003D6 RID: 982 RVA: 0x0001BABC File Offset: 0x00019CBC internal static bool IsTimeToDie(object[] itemProperties, EnhancedTimeSpan ageLimit, string itemClass, PropertyIndexHolder propertyIndexHolder, MailboxSession session, int hashCode, string enforcerName, Trace TracerHandle, DateTime Now) { DefaultFolderType defaultFolderType = DefaultFolderType.None; if (((StoreObjectId)itemProperties[propertyIndexHolder.ParentItemIdIndex]).Equals(session.GetDefaultFolderId(DefaultFolderType.DeletedItems))) { TracerHandle.TraceDebug <string, string>((long)hashCode, "{0}: Item of class {1} is in the Deleted Items folder.", enforcerName, itemClass); defaultFolderType = DefaultFolderType.DeletedItems; } ItemStartDateCalculator itemStartDateCalculator = new ItemStartDateCalculator(propertyIndexHolder, defaultFolderType.ToString(), defaultFolderType, session, ExpirationTagEnforcer.Tracer); DateTime startDate = itemStartDateCalculator.GetStartDate((VersionedId)itemProperties[propertyIndexHolder.IdIndex], itemClass, itemProperties); TracerHandle.TraceDebug((long)hashCode, "{0}: Item class: {1}. Start date is {2}. Applicable age limit is {3}", new object[] { enforcerName, itemClass, startDate, ageLimit }); return(!(startDate == DateTime.MinValue) && Now.Subtract(startDate) > ageLimit); }
// Token: 0x060001C7 RID: 455 RVA: 0x0000C2B4 File Offset: 0x0000A4B4 protected void AddToReport(RetentionActionType policy, object[] itemProperties, PropertyIndexHolder propertyIndexHolder, Dictionary <Guid, string> allPolicyTags) { try { if (this.isReportEnabled) { object propertyObject = this.GetPropertyObject(itemProperties[propertyIndexHolder.ConversationTopic]); object propertyObject2 = this.GetPropertyObject(itemProperties[propertyIndexHolder.MessageSenderDisplayName]); object propertyObject3 = this.GetPropertyObject(itemProperties[propertyIndexHolder.ParentDisplayName]); object propertyObject4 = this.GetPropertyObject(itemProperties[propertyIndexHolder.ReceivedTimeIndex]); object propertyObject5 = this.GetPropertyObject(itemProperties[propertyIndexHolder.LastModifiedTime]); Guid key = (itemProperties[propertyIndexHolder.PolicyTagIndex] is PropertyError) ? Guid.Empty : new Guid((byte[])itemProperties[propertyIndexHolder.PolicyTagIndex]); Guid key2 = (itemProperties[propertyIndexHolder.ArchiveTagIndex] is PropertyError) ? Guid.Empty : new Guid((byte[])itemProperties[propertyIndexHolder.ArchiveTagIndex]); bool flag = (!(itemProperties[propertyIndexHolder.MessageToMe] is PropertyError) && (bool)itemProperties[propertyIndexHolder.MessageToMe]) || (!(itemProperties[propertyIndexHolder.MessageCcMe] is PropertyError) && (bool)itemProperties[propertyIndexHolder.MessageCcMe]); object obj = key.Equals(Guid.Empty) ? Strings.ElcEmailDefaultTag : (allPolicyTags.ContainsKey(key) ? allPolicyTags[key] : Strings.ElcEmailUnknownTag); object obj2 = key2.Equals(Guid.Empty) ? Strings.ElcEmailDefaultTag : (allPolicyTags.ContainsKey(key2) ? allPolicyTags[key2] : Strings.ElcEmailUnknownTag); object item = null; object item2 = null; if (policy.Equals(RetentionActionType.MoveToArchive)) { item = obj2; item2 = obj; } else { item = obj; item2 = obj2; } if (!this.ELCReport.ContainsKey(policy)) { this.ELCReport.Add(policy, new List <List <object> >()); } if (this.ELCReport[policy].Count < ElcGlobals.ReportItemLimit) { foreach (List <object> list in this.ELCReport[policy]) { if (list[0].Equals(itemProperties[propertyIndexHolder.ConversationId])) { if (((ExDateTime)propertyObject4).CompareTo(list[4]) < 0) { list[2] = propertyObject2; list[3] = propertyObject3; list[6] = propertyObject4; list[7] = propertyObject5; list[8] = (int)list[8] + 1; } return; } } List <object> list2 = new List <object>(9); list2.Add(itemProperties[propertyIndexHolder.ConversationId]); list2.Add(propertyObject); list2.Add(propertyObject2); list2.Add(propertyObject3); list2.Add(item); list2.Add(item2); list2.Add(propertyObject4); list2.Add(propertyObject5); list2.Add(1); if (flag) { this.ELCReport[policy].Insert(0, list2); this.separationIndices[policy] = this.separationIndices[policy] + 1; } else { this.ELCReport[policy].Add(list2); } } else { foreach (List <object> list3 in this.ELCReport[policy]) { if (list3[0].Equals(itemProperties[propertyIndexHolder.ConversationId])) { if (((ExDateTime)itemProperties[propertyIndexHolder.ReceivedTimeIndex]).CompareTo(list3[6]) < 0) { list3[2] = propertyObject2; list3[3] = propertyObject3; list3[6] = propertyObject4; list3[7] = propertyObject5; list3[8] = (int)list3[8] + 1; } return; } } if (this.separationIndices[policy] < ElcGlobals.ReportItemLimit) { if (flag) { List <object> list4 = new List <object>(9); list4.Add(itemProperties[propertyIndexHolder.ConversationId]); list4.Add(propertyObject); list4.Add(propertyObject2); list4.Add(propertyObject3); list4.Add(item); list4.Add(item2); list4.Add(propertyObject4); list4.Add(propertyObject5); list4.Add(1); this.ELCReport[policy][this.separationIndices[policy]] = list4; this.separationIndices[policy] = this.separationIndices[policy] + 1; this.elcReportOverflow = true; } else { this.elcReportOverflow = true; } } else { this.elcReportOverflow = true; } } } } catch (IndexOutOfRangeException ex) { this.tracer.TraceError <ExpirationExecutor>((long)this.GetHashCode(), "{0}: Didn't receive a parameter for an item that's being reported: " + ex.Message, this); StatisticsLogEntry statisticsLogEntry = this.MailboxData.StatisticsLogEntry; statisticsLogEntry.ExceptionType += ex.GetType(); this.MailboxData.StatisticsLogEntry.AddExceptionToLog(ex); } finally { if (this.ELCReport.ContainsKey(policy) && this.ELCReport[policy].Count == 0) { this.ELCReport.Remove(policy); } } }
// Token: 0x06000303 RID: 771 RVA: 0x00012F24 File Offset: 0x00011124 internal override void Invoke(ProvisionedFolder provisionedFolder, List <object[]> items, PropertyIndexHolder propertyIndexHolder) { AutoCopyEnforcer.TracerPfd.TracePfd <int, Folder>((long)this.GetHashCode(), "PFD IWE {0} {1} AutoCopyEnforcer Invoked", 18711, provisionedFolder.Folder); using (Folder folder = Folder.Bind(base.MailboxData.MailboxSession, this.SendFolderId)) { foreach (object[] array in items) { if (array[propertyIndexHolder.IdIndex] is VersionedId) { VersionedId versionedId = (VersionedId)array[propertyIndexHolder.IdIndex]; provisionedFolder.CurrentItems = new VersionedId[] { versionedId }; object obj = array[propertyIndexHolder.AutoCopiedIndex]; if (obj is byte[]) { AutoCopyEnforcer.Tracer.TraceDebug <object, VersionedId>((long)this.GetHashCode(), "{0}: ignoring item '{1}' because it has been copied already.", TraceContext.Get(), versionedId); } else { string text = array[propertyIndexHolder.ItemClassIndex] as string; text = ((text == null) ? string.Empty : text.ToLower()); ContentSetting applyingPolicy = ElcPolicySettings.GetApplyingPolicy(provisionedFolder.ElcPolicies, text, provisionedFolder.ItemClassToPolicyMapping); if (applyingPolicy != null && applyingPolicy.JournalingEnabled) { ItemAuditLogData itemAuditLogData = null; if (base.MailboxData.ElcAuditLog.AutocopyLoggingEnabled) { itemAuditLogData = new ItemAuditLogData(array, propertyIndexHolder, new FolderAuditLogData(provisionedFolder, base.MailboxData, ELCAction.Journaling.ToString(), this.GetOfficialFileParticipant(applyingPolicy).EmailAddress)); } ItemData itemData = new ItemData(versionedId, (array[propertyIndexHolder.ReceivedTimeIndex] is ExDateTime) ? ((DateTime)((ExDateTime)array[propertyIndexHolder.ReceivedTimeIndex])) : DateTime.MinValue, itemAuditLogData, (int)array[propertyIndexHolder.SizeIndex]); StoreObjectId storeObjectId; bool flag = this.SendItemAsAttachement(applyingPolicy, itemData, out storeObjectId); if (flag) { this.MarkItemAsCopied(itemData, provisionedFolder); ELCPerfmon.TotalItemsAutoCopied.Increment(); } else { Exception ex = null; OperationResult operationResult = OperationResult.Succeeded; try { operationResult = folder.DeleteObjects(DeleteItemFlags.HardDelete, new StoreObjectId[] { storeObjectId }).OperationResult; } catch (Exception ex2) { operationResult = OperationResult.Failed; ex = ex2; } if (operationResult != OperationResult.Succeeded) { AutoCopyEnforcer.Tracer.TraceDebug <object, string, string>((long)this.GetHashCode(), "{0}: Failed to delete the journal message '{1}'. Exception: '{2}'.", TraceContext.Get(), storeObjectId.ToString(), (ex == null) ? "" : ex.Message); } } } } } } } }
// Token: 0x060003D2 RID: 978 RVA: 0x0001B678 File Offset: 0x00019878 private void EnlistItem(object[] itemProperties, int policyIndex, int dateIndex, PropertyIndexHolder propertyIndexHolder) { string messageClass; if (!this.PreScreenPassed(itemProperties, propertyIndexHolder, out messageClass)) { return; } if (itemProperties[dateIndex] == null || itemProperties[dateIndex] is PropertyError) { ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Item has null Retention Date. Skipping it.", this); return; } Guid value = ElcMailboxHelper.GetGuidFromBytes(itemProperties[policyIndex], new Guid?(Guid.Empty), false, (VersionedId)itemProperties[propertyIndexHolder.IdIndex]).Value; if (value.Equals(Guid.Empty)) { ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Item has no retention tag. Skipping it.", this); return; } ContentSetting retentionEnabledSettingForTag = ((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetRetentionEnabledSettingForTag(value, messageClass); if (retentionEnabledSettingForTag == null) { ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Could not find a Content Setting for this item. Skipping it.", this); return; } Dictionary <Guid, AdTagData> allTags = ((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetAllTags(); Dictionary <Guid, string> dictionary = new Dictionary <Guid, string>(); foreach (KeyValuePair <Guid, AdTagData> keyValuePair in allTags) { dictionary.Add(keyValuePair.Key, keyValuePair.Value.Tag.Name); } this.tagExpirationExecutor.AddToReportAndDoomedList(itemProperties, propertyIndexHolder, retentionEnabledSettingForTag, dictionary, ItemData.EnforcerType.ExpirationTagEnforcer, false); if (((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetTag(value).Tag.Type == ElcFolderType.Personal) { if (retentionEnabledSettingForTag.RetentionAction == RetentionActionType.MoveToArchive) { this.numberItemsMovedByPersonal++; return; } this.numberItemsExpiredByPersonal++; return; } else { if (((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetTag(value).Tag.Type != ElcFolderType.All) { this.numberItemsExpiredBySystem++; return; } if (retentionEnabledSettingForTag.RetentionAction == RetentionActionType.MoveToArchive) { this.numberItemsMovedByDefault++; return; } this.numberItemsExpiredByDefault++; return; } }
// Token: 0x06000330 RID: 816 RVA: 0x0001413F File Offset: 0x0001233F internal void AddToReportAndDoomedList(object[] itemProperties, PropertyIndexHolder propertyIndexHolder, ContentSetting settings, ItemData itemData, string itemClass, Dictionary <Guid, string> allPolicyTags) { base.AddToReport(settings.RetentionAction, itemProperties, propertyIndexHolder, allPolicyTags); this.AddToDoomedList(itemData, settings, itemClass); }
// Token: 0x0600037C RID: 892 RVA: 0x000180B4 File Offset: 0x000162B4 internal override void Invoke(ProvisionedFolder provisionedFolder, List <object[]> items, PropertyIndexHolder propertyIndexHolder) { FolderExpirationExecutor folderExpirationExecutor = new FolderExpirationExecutor(provisionedFolder, base.MailboxData, base.Assistant); ExpirationEnforcer.Tracer.TraceDebug <object, string, int>((long)this.GetHashCode(), "{0}: Number of items found in folder '{1}' is {2}.", TraceContext.Get(), provisionedFolder.DisplayName, items.Count); DefaultFolderType folderType = DefaultFolderType.None; if (provisionedFolder.FolderId.Equals(base.MailboxData.MailboxSession.GetDefaultFolderId(DefaultFolderType.DeletedItems))) { folderType = DefaultFolderType.DeletedItems; } else if (provisionedFolder.ContainerClass != null && ObjectClass.IsCalendarFolder(provisionedFolder.ContainerClass)) { folderType = DefaultFolderType.Calendar; } else if (provisionedFolder.ContainerClass != null && ObjectClass.IsTaskFolder(provisionedFolder.ContainerClass)) { folderType = DefaultFolderType.Tasks; } ItemStartDateCalculator itemStartDateCalculator = new ItemStartDateCalculator(propertyIndexHolder, provisionedFolder.Folder.DisplayName, folderType, base.MailboxData.MailboxSession, ExpirationEnforcer.Tracer); FolderAuditLogData folderAuditLogData = null; if (base.MailboxData.ElcAuditLog.ExpirationLoggingEnabled) { folderAuditLogData = new FolderAuditLogData(provisionedFolder, base.MailboxData, ELCAction.Retention.ToString()); } foreach (object[] array in items) { VersionedId versionedId = array[propertyIndexHolder.IdIndex] as VersionedId; string text = array[propertyIndexHolder.ItemClassIndex] as string; if (versionedId == null) { ExpirationEnforcer.Tracer.TraceDebug <object, string>((long)this.GetHashCode(), "{0}: Current item in folder {1} is null. Skipping it.", TraceContext.Get(), provisionedFolder.DisplayName); } else { provisionedFolder.CurrentItems = new VersionedId[] { versionedId }; text = ((text == null) ? string.Empty : text.ToLower()); ContentSetting contentSetting = null; contentSetting = ElcPolicySettings.GetApplyingPolicy(provisionedFolder.ElcPolicies, text, provisionedFolder.ItemClassToPolicyMapping); if (contentSetting == null) { ExpirationEnforcer.Tracer.TraceDebug <object, string, string>((long)this.GetHashCode(), "{0}: Policy for item class {1} in folder {2} is null. Skipping item.", TraceContext.Get(), text, provisionedFolder.DisplayName); } else if (!base.MailboxData.FolderProcessor.IsPolicyValid(provisionedFolder, contentSetting, text, base.MailboxData)) { ExpirationEnforcer.Tracer.TraceDebug <object, string, string>((long)this.GetHashCode(), "{0}: Removing policy {1} from the list in folder {2} because it is invalid.", TraceContext.Get(), contentSetting.Name, provisionedFolder.DisplayName); provisionedFolder.RemovePolicy(contentSetting); } else { double totalDays = contentSetting.AgeLimitForRetention.Value.TotalDays; int num; if (contentSetting.TriggerForRetention == RetentionDateType.WhenMoved) { ExpirationEnforcer.Tracer.TraceDebug <object, string>((long)this.GetHashCode(), "{0}: Applying policy. Policy '{1}' expires based on move date.", TraceContext.Get(), contentSetting.Name); CompositeProperty compositeProperty = null; if (ElcMailboxHelper.Exists(array[propertyIndexHolder.MoveDateIndex])) { try { compositeProperty = CompositeProperty.Parse((byte[])array[propertyIndexHolder.MoveDateIndex]); } catch (ArgumentException ex) { ExpirationEnforcer.Tracer.TraceError((long)this.GetHashCode(), "{0}: Could not parse move date property of item. Folder: {1} ItemClass: {2} Exception: {3}.", new object[] { TraceContext.Get(), provisionedFolder.DisplayName, text, ex }); base.MailboxData.ThrowIfErrorsOverLimit(); } } if (compositeProperty == null) { string arg = "Stamped Move date is null."; ExpirationEnforcer.Tracer.TraceDebug <object, VersionedId, string>((long)this.GetHashCode(), "{0}: Move date needs to be stamped on item {1}. {2}", TraceContext.Get(), versionedId, arg); folderExpirationExecutor.AddToMoveDateStampingList(new ItemData(versionedId, (int)array[propertyIndexHolder.SizeIndex])); continue; } ExpirationEnforcer.Tracer.TraceDebug <object, VersionedId>((long)this.GetHashCode(), "{0}: Calculating age of item {1} based on move date", TraceContext.Get(), versionedId); num = (int)base.MailboxData.Now.Subtract(compositeProperty.Date.Value).TotalDays; } else { DateTime startDate = itemStartDateCalculator.GetStartDate(versionedId, text, array); if (startDate == DateTime.MinValue) { num = 0; } else { num = (int)base.MailboxData.UtcNow.Subtract(startDate).TotalDays; } } try { if ((double)num >= totalDays) { if (contentSetting.RetentionAction == RetentionActionType.MarkAsPastRetentionLimit && array[propertyIndexHolder.ExpiryTimeIndex] != null && !(array[propertyIndexHolder.ExpiryTimeIndex] is PropertyError)) { ExpirationEnforcer.Tracer.TraceDebug <object, VersionedId>((long)this.GetHashCode(), "{0}: Item {1} is already tagged with expiry time, hence will not tag again.", TraceContext.Get(), versionedId); } else { ExpirationEnforcer.Tracer.TraceDebug <object, VersionedId>((long)this.GetHashCode(), "{0}: Adding item {1} to list to be expired.", TraceContext.Get(), versionedId); ItemAuditLogData itemAuditLogData = null; if (base.MailboxData.ElcAuditLog.ExpirationLoggingEnabled) { folderAuditLogData.ExpirationAction = contentSetting.RetentionAction.ToString(); itemAuditLogData = new ItemAuditLogData(array, propertyIndexHolder, folderAuditLogData); } ItemData itemData = new ItemData(versionedId, (array[propertyIndexHolder.ReceivedTimeIndex] is ExDateTime) ? ((DateTime)((ExDateTime)array[propertyIndexHolder.ReceivedTimeIndex])) : DateTime.MinValue, itemAuditLogData, (int)array[propertyIndexHolder.SizeIndex]); folderExpirationExecutor.AddToReportAndDoomedList(array, propertyIndexHolder, contentSetting, itemData, text, this.allPolicyTags); } } } catch (InvalidExpiryDestinationException ex2) { ExpirationEnforcer.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: Removing policy '{1}', that applies to folder '{2}' from list of policies to process. Exception: {3}", new object[] { TraceContext.Get(), contentSetting.Name, contentSetting.ManagedFolderName, ex2 }); provisionedFolder.RemovePolicy(contentSetting); } catch (SkipFolderException ex3) { ExpirationEnforcer.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: Policy '{1}', that applies to folder '{2}' will be skipped for the current folder. Exception: {3}", new object[] { TraceContext.Get(), contentSetting.Name, contentSetting.ManagedFolderName, ex3 }); return; } } } } ExpirationEnforcer.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: Done identifying items for expiration. Proceed to expire.", new object[] { TraceContext.Get() }); ExpirationEnforcer.TracerPfd.TracePfd <int, object>((long)this.GetHashCode(), "PFD IWE {0} {1}: Done identifying items for expiration. Calling ExpirationExecutor to expire.", 26903, TraceContext.Get()); folderExpirationExecutor.ExecuteTheDoomed(); }