private static bool TryEnqueueNextHopAfterHARedirect(MessageTrackingLogEntry haRedirectEvent, TrackingContext context, Queue <MailItemTracker> remainingTrackers) { ServerInfo nextHopServer = haRedirectEvent.GetNextHopServer(); if (LogDataAnalyzer.ShouldSkipTracker(nextHopServer, haRedirectEvent, context)) { return(false); } ILogReader logReader = RpcLogReader.GetLogReader(haRedirectEvent.NextHopFqdnOrName, context.DirectoryContext); if (logReader == null) { return(false); } List <MessageTrackingLogEntry> messageLog = context.Cache.GetMessageLog(RpcReason.None, logReader, TrackingLogPrefix.MSGTRK, haRedirectEvent.MessageId, null, SearchMessageTrackingReportImpl.HAReceiveOrResubmitEventsFilterSet); if (messageLog.Count == 0) { TraceWrapper.SearchLibraryTracer.TraceError <MessageTrackingLogEntry, string>(0, "Could not find any HA receive events to match {0} on {1}.", haRedirectEvent, haRedirectEvent.NextHopFqdnOrName); return(false); } MailItemTracker item = new MailItemTracker(messageLog, context.Tree); remainingTrackers.Enqueue(item); return(true); }
private static bool TryEnqueueNextHopAfterSubmitInternal(MessageTrackingLogEntry submitEvent, TrackingContext context, Queue <MailItemTracker> remainingTrackers, bool searchAfterModerationApproval) { ServerInfo nextHopServer = submitEvent.GetNextHopServer(); if (LogDataAnalyzer.ShouldSkipTracker(nextHopServer, submitEvent, context)) { return(false); } ILogReader logReader = RpcLogReader.GetLogReader(submitEvent.NextHopFqdnOrName, context.DirectoryContext); if (logReader == null) { return(false); } List <MessageTrackingLogEntry> messageLog = context.Cache.GetMessageLog(RpcReason.None, logReader, TrackingLogPrefix.MSGTRK, submitEvent.MessageId, new MessageTrackingSource?((logReader.MtrSchemaVersion >= MtrSchemaVersion.E15RTM) ? MessageTrackingSource.SMTP : MessageTrackingSource.STOREDRIVER), SearchMessageTrackingReportImpl.ReceiveEventFilterSet); if (messageLog.Count == 0) { TraceWrapper.SearchLibraryTracer.TraceDebug <string, string, MessageTrackingLogEntry>(0, "No {0} Receive event found on {1} to match {2}.", (logReader.MtrSchemaVersion >= MtrSchemaVersion.E15RTM) ? "SMTP" : "StoreDriver", submitEvent.NextHopFqdnOrName, submitEvent); return(false); } long num; if (!searchAfterModerationApproval) { num = messageLog[0].ServerLogKeyMailItemId; } else { num = LogDataAnalyzer.GetCheckReceiveEventAfterModerationApproval(messageLog, context, logReader); if (num == 0L) { return(false); } } foreach (MessageTrackingLogEntry messageTrackingLogEntry in messageLog) { LogDataAnalyzer.CreateAndEnqueueTracker(context, remainingTrackers, logReader, TrackingLogPrefix.MSGTRK, messageTrackingLogEntry.MessageId, num); } return(true); }
private static bool TryEnqueueNextHopAfterSend(MessageTrackingLogEntry sendEvent, TrackingContext context, Queue <MailItemTracker> remainingTrackers) { ServerInfo nextHopServer = sendEvent.GetNextHopServer(); if (LogDataAnalyzer.ShouldSkipTracker(nextHopServer, sendEvent, context)) { return(false); } ILogReader logReader = RpcLogReader.GetLogReader(sendEvent.NextHopFqdnOrName, context.DirectoryContext); if (logReader == null) { return(false); } MessageTrackingSource? sourceFilter = null; HashSet <MessageTrackingEvent> eventIdFilterSet = SearchMessageTrackingReportImpl.ReceiveOrDeliverEventsFilterSet; if (logReader.MtrSchemaVersion < MtrSchemaVersion.E15RTM) { sourceFilter = new MessageTrackingSource?(MessageTrackingSource.SMTP); eventIdFilterSet = SearchMessageTrackingReportImpl.ReceiveEventFilterSet; } List <MessageTrackingLogEntry> messageLog = context.Cache.GetMessageLog(RpcReason.None, logReader, TrackingLogPrefix.MSGTRK, sendEvent.MessageId, sourceFilter, eventIdFilterSet); if (messageLog.Count == 0) { return(false); } foreach (MessageTrackingLogEntry messageTrackingLogEntry in messageLog) { if (LogDataAnalyzer.CheckRecipientListEquality(sendEvent, messageTrackingLogEntry)) { LogDataAnalyzer.CreateAndEnqueueTracker(context, remainingTrackers, logReader, TrackingLogPrefix.MSGTRK, messageTrackingLogEntry.MessageId, messageTrackingLogEntry.ServerLogKeyMailItemId); return(true); } } TraceWrapper.SearchLibraryTracer.TraceError <MessageTrackingLogEntry, string>(0, "Could not find any receive events to match {0} on {1}.", sendEvent, sendEvent.NextHopFqdnOrName); return(false); }