Esempio n. 1
0
        // Token: 0x0600003A RID: 58 RVA: 0x00003ACC File Offset: 0x00001CCC
        private void LogMessageTrackingInfo(string remoteHostName, IPAddress localIP, string localServerName, MapiEvent mapiEvent, MailSubmissionResult result, string latencyString)
        {
            SubmissionRecord.Drop(this.successHistory, this.failureHistory, mapiEvent, result);
            string text = this.FormatMapiEventInfo(mapiEvent);
            MsgTrackMapiSubmitInfo msgTrackInfo;

            if (result.ErrorCode == 0U)
            {
                MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TracePass <string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "Submission succeeded for {0}", text);
                msgTrackInfo = new MsgTrackMapiSubmitInfo(text, null, remoteHostName, localIP, localServerName, result.Sender, result.From, result.MessageId, MailboxTransportSubmissionAssistant.ItemEntryId(mapiEvent), Components.Configuration.LocalServer.TransportServer.MessageTrackingLogSubjectLoggingEnabled ? result.Subject : "[Undisclosed]", latencyString, result.DiagnosticInfo, null != mapiEvent, result.ExternalOrganizationId, result.OrganizationId, result.RecipientAddresses, MailDirectionality.Originating, result.NetworkMessageId, result.OriginalClientIPAddress);
            }
            else
            {
                string text2 = HResult.GetStringForErrorCode(result.ErrorCode);
                if (!string.IsNullOrEmpty(result.DiagnosticInfo))
                {
                    text2 = "Error: " + text2 + ", Diagnostic Information: " + result.DiagnosticInfo;
                }
                MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TracePass <string, string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "Submission failed for {0}, error: {1}", text, text2);
                if (!HResult.IsHandled(result.ErrorCode) && !MailboxTransportSubmissionAssistant.ShouldLogTemporaryFailures)
                {
                    return;
                }
                msgTrackInfo = new MsgTrackMapiSubmitInfo(text, null, remoteHostName, localIP, localServerName, result.Sender, result.MessageId, MailboxTransportSubmissionAssistant.ItemEntryId(mapiEvent), latencyString, text2, HResult.IsHandled(result.ErrorCode), null != mapiEvent, result.ExternalOrganizationId, result.OrganizationId, result.RecipientAddresses, MailDirectionality.Originating, result.NetworkMessageId);
            }
            if (11U == result.ErrorCode)
            {
                MessageTrackingLog.TrackThrottle(MessageTrackingSource.STOREDRIVER, msgTrackInfo, result.Sender, result.MessageId, MailDirectionality.Originating);
                return;
            }
            MessageTrackingLog.TrackMapiSubmit(msgTrackInfo);
        }
Esempio n. 2
0
 // Token: 0x06000025 RID: 37 RVA: 0x00003428 File Offset: 0x00001628
 public void OnSkipEvent(MapiEvent mapiEvent, Exception exception)
 {
     try
     {
         MailboxTransportSubmissionAssistant.eventCounterToLatencyMap.Remove(mapiEvent.EventCounter);
         string    text = this.FormatMapiEventInfo(mapiEvent);
         Exception ex   = exception;
         if (ex != null)
         {
             while (ex.InnerException != null)
             {
                 ex = ex.InnerException;
             }
         }
         string text2 = "Error: SkipEvent";
         if (ex != null)
         {
             text2 = text2 + ", Diagnostic Information: " + ex.GetType().Name;
         }
         MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TraceFail <string, string>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "{0} will be skipped due to error {1}", text, text2);
         MsgTrackMapiSubmitInfo msgTrackInfo = new MsgTrackMapiSubmitInfo(text, null, string.Empty, StoreDriverSubmission.LocalIPAddress, Components.Configuration.LocalServer.TransportServer.Name, string.Empty, string.Empty, mapiEvent.ItemEntryId, string.Empty, text2, true, false);
         MessageTrackingLog.TrackMapiSubmit(msgTrackInfo);
     }
     catch (Exception arg)
     {
         MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TraceFail <Exception>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "Unexpected exception {0} during skipped event logging", arg);
     }
 }
Esempio n. 3
0
        // Token: 0x06000024 RID: 36 RVA: 0x000030E0 File Offset: 0x000012E0
        public void HandleEvent(MapiEvent mapiEvent, MailboxSession itemStore, StoreObject item)
        {
            MailboxTransportSubmissionAssistant.IdentifyProbeMessage(mapiEvent);
            Thread currentThread = Thread.CurrentThread;

            try
            {
                Interlocked.Increment(ref this.concurrentEvents);
                this.SubmissionsInProgress[currentThread] = new SubmissionsInProgress.Entry(ExDateTime.UtcNow, this.databaseInfo.Guid, mapiEvent);
                using (new SenderGuidTraceFilter(this.databaseInfo.Guid, mapiEvent.MailboxGuid))
                {
                    bool flag = true;
                    MailboxTransportSubmissionAssistant.LatencyRecord latencyRecord;
                    LatencyTracker latencyTracker;
                    if (MailboxTransportSubmissionAssistant.eventCounterToLatencyMap.TryGetValue(mapiEvent.EventCounter, out latencyRecord))
                    {
                        MailboxTransportSubmissionAssistant.eventCounterToLatencyMap.Remove(mapiEvent.EventCounter);
                        latencyTracker = latencyRecord.LatencyTracker;
                        LatencyTracker.EndTrackLatency(latencyRecord.LatencyComponent, latencyTracker, true);
                        flag = false;
                    }
                    else
                    {
                        latencyTracker = LatencyTracker.CreateInstance(LatencyComponent.MailboxTransportSubmissionService);
                        LatencyTracker.TrackPreProcessLatency(LatencyComponent.SubmissionAssistant, latencyTracker, mapiEvent.CreateTime);
                    }
                    LatencyTracker.BeginTrackLatency(LatencyComponent.MailboxTransportSubmissionService, latencyTracker);
                    string text = this.FormatMapiEventInfo(mapiEvent);
                    this.LogMapiEventIntoCrimsonChannelPeriodically(text);
                    this.SubmissionsInProgress[Thread.CurrentThread].LatencyTracker = latencyTracker;
                    if (MailboxTransportSubmissionAssistant.ShouldLogNotifyEvents && (flag || MailboxTransportSubmissionAssistant.ShouldLogTemporaryFailures))
                    {
                        LatencyFormatter       latencyFormatter = new LatencyFormatter(latencyTracker, Components.Configuration.LocalServer.TransportServer.Fqdn, mapiEvent.CreateTime, mapiEvent.CreateTime, true, false, false);
                        MsgTrackMapiSubmitInfo msgTrackInfo     = new MsgTrackMapiSubmitInfo(text, null, string.Empty, StoreDriverSubmission.LocalIPAddress, Components.Configuration.LocalServer.TransportServer.Name, string.Empty, string.Empty, MailboxTransportSubmissionAssistant.ItemEntryId(mapiEvent), latencyFormatter.FormatAndUpdatePerfCounters(), null, false, true);
                        MessageTrackingLog.TrackNotify(msgTrackInfo, false);
                    }
                    MSExchangeSubmission.PendingSubmissions.Increment();
                    new HashSet <string>();
                    DateTime createTime = mapiEvent.CreateTime;
                    MailboxTransportSubmissionService.StoreDriverTracer.ServiceTracer.TracePfdPass <int, Guid, long>(MailboxTransportSubmissionService.StoreDriverTracer.MessageProbeActivityId, (long)this.GetHashCode(), "PFD EMS {0} SubmitMail for mailbox {1} at entry {2}", 22427, mapiEvent.MailboxGuid, mapiEvent.EventCounter);
                    LatencyFormatter latencyFormatter2 = new LatencyFormatter(latencyTracker, Components.Configuration.LocalServer.TransportServer.Fqdn, createTime, createTime, false, true, false);
                    bool             isPublicFolder    = mapiEvent.ExtendedEventFlags.HasFlag(MapiExtendedEventFlags.PublicFolderMailbox);
                    LatencyTracker.BeginTrackLatency(LatencyComponent.MailboxTransportSubmissionStoreDriverSubmission, latencyTracker);
                    ISubmissionProvider  submissionProvider   = (ISubmissionProvider)Components.StoreDriverSubmission;
                    MailSubmissionResult mailSubmissionResult = submissionProvider.SubmitMessage(Components.Configuration.LocalServer.TransportServer.ExchangeLegacyDN, mapiEvent.MailboxGuid, this.databaseInfo.Guid, this.databaseInfo.DatabaseName, mapiEvent.EventCounter, mapiEvent.ItemEntryId, mapiEvent.ParentEntryId, Components.Configuration.LocalServer.TransportServer.Fqdn, new IPAddress(StoreDriverSubmission.LocalIPAddress.GetAddressBytes()), mapiEvent.CreateTime, isPublicFolder, (mapiEvent.TenantHint == null) ? null : TenantPartitionHint.FromPersistablePartitionHint(mapiEvent.TenantHint), latencyFormatter2.FormatAndUpdatePerfCounters(), MailboxTransportSubmissionService.QuarantineHandler, MailboxTransportSubmissionService.SubmissionPoisonHandler, latencyTracker);
                    MailSubmissionResult result = mailSubmissionResult;
                    LatencyTracker.EndTrackLatency(LatencyComponent.MailboxTransportSubmissionStoreDriverSubmission, latencyTracker);
                    LatencyTracker.EndTrackLatency(LatencyComponent.MailboxTransportSubmissionService, latencyTracker);
                    this.LogAndUpdateCounters(mapiEvent, latencyTracker, createTime, result);
                    this.HandleEventError(mapiEvent, result, latencyTracker, text);
                }
            }
            finally
            {
                MSExchangeSubmission.PendingSubmissions.Decrement();
                Interlocked.Decrement(ref this.concurrentEvents);
                this.SubmissionsInProgress.Remove(currentThread);
            }
        }