internal override void InternalProcessRecord() { base.InternalProcessRecord(); if (!this.sourceServerHasMdb) { base.AddSuccessMonitoringEvent(1000, Strings.TestMailflowSucceededNoDatabaseOnSourceServer(base.SourceMailboxServer.Name)); base.Task.WriteWarning(Strings.TestMailflowServerWithoutMdbs(base.SourceMailboxServer.Name)); return; } if (!this.targetServerHasMdb) { base.AddSuccessMonitoringEvent(1000, Strings.TestMailflowSucceededNoDatabaseOnTargetServer(base.Task.TargetMailboxServer.ToString())); base.Task.WriteWarning(Strings.TestMailflowServerWithoutMdbs(base.Task.TargetMailboxServer.ToString())); return; } using (MapiStore mapiStore = MapiStore.OpenMailbox(base.SourceMailboxServer.Fqdn, base.SourceSystemMailbox.LegacyExchangeDN, base.SourceSystemMailbox.ExchangeGuid, base.SourceSystemMailbox.Database.ObjectGuid, base.SourceSystemMailbox.Name, null, null, ConnectFlag.UseAdminPrivilege | ConnectFlag.UseSeparateConnection, OpenStoreFlag.UseAdminPrivilege | OpenStoreFlag.TakeOwnership | OpenStoreFlag.MailboxGuid, CultureInfo.InvariantCulture, null, "Client=Management;Action=LegacyTestMailFlow", null)) { using (MapiFolder outboxFolder = mapiStore.GetOutboxFolder()) { using (MapiFolder inboxFolder = mapiStore.GetInboxFolder()) { LegacyTestMailFlowHelper.CleanUpInbox(inboxFolder); string subject = string.Format("Test-Mailflow {0} {1}", Guid.NewGuid(), "66c7004a-6860-44b2-983a-327aa3c9cfec"); TestMailFlowHelper.CreateAndSubmitMessage(outboxFolder, base.SourceSystemMailbox.Name, this.targetMailboxAddress, subject, true); this.WaitAndProcessDeliveryReceipt(inboxFolder, subject, this.friendlySourceAddress, this.friendlyTargetAddress, this.GetPerfInstanceName()); } } } }
internal override void InternalProcessRecord() { base.InternalProcessRecord(); if (base.Task.MonitoringContext && !this.IsFirstActiveMdbLocallyMounted()) { base.AddInformationMonitoringEvent(2004, Strings.CrossPremiseServerNotSelected(base.SourceMailboxServer.Name)); return; } List <SmtpAddress> siteEgressTargets = this.GetSiteEgressTargets(); if (siteEgressTargets.Count <SmtpAddress>() == 0) { base.AddWarningMonitoringEvent(2003, Strings.CrossPremiseNoEgressTargets(base.SourceMailboxServer.Name)); base.Task.WriteWarning(Strings.CrossPremiseNoEgressTargets(base.SourceMailboxServer.Name)); return; } ADSystemMailbox adsystemMailbox = this.localSystemMailbox as ADSystemMailbox; using (MapiStore mapiStore = MapiStore.OpenMailbox(base.SourceMailboxServer.Fqdn, this.localSystemMailbox.LegacyExchangeDN, adsystemMailbox.ExchangeGuid, adsystemMailbox.Database.ObjectGuid, this.localSystemMailbox.Name, null, null, ConnectFlag.UseAdminPrivilege | ConnectFlag.UseSeparateConnection, OpenStoreFlag.UseAdminPrivilege | OpenStoreFlag.TakeOwnership | OpenStoreFlag.MailboxGuid, CultureInfo.InvariantCulture, null, "Client=Management;Action=CrossPremiseTestMailFlow", null)) { using (MapiFolder rootFolder = mapiStore.GetRootFolder()) { using (MapiFolder inboxFolder = mapiStore.GetInboxFolder()) { using (MapiFolder mapiFolder = rootFolder.CreateFolder("Cross Premise", "The folder for cross premise mailflow monitoring.", true)) { if (base.Task.MonitoringContext) { this.MatchCrossPremiseMessages(inboxFolder, mapiFolder, this.localSystemMailbox.WindowsEmailAddress, siteEgressTargets); using (List <SmtpAddress> .Enumerator enumerator = siteEgressTargets.GetEnumerator()) { while (enumerator.MoveNext()) { SmtpAddress smtpAddress = enumerator.Current; string subject = string.Format("{0}{{{1}}}", "CrossPremiseMailFlowMonitoring-", Guid.NewGuid()); TestMailFlowHelper.CreateAndSubmitMessage(mapiFolder, this.localSystemMailbox.Name, smtpAddress.ToString(), subject, false); } goto IL_238; } } Dictionary <string, string> dictionary = new Dictionary <string, string>(); ExDateTime utcNow = ExDateTime.UtcNow; foreach (SmtpAddress smtpAddress2 in siteEgressTargets) { string text = string.Format("{0}{{{1}}}", "CrossPremiseMailFlowMonitoring-", Guid.NewGuid()); TestMailFlowHelper.CreateAndSubmitMessage(mapiFolder, this.localSystemMailbox.Name, smtpAddress2.ToString(), text, true); dictionary[text] = smtpAddress2.ToString(); } this.WaitAndProcessProbeResponses(inboxFolder, this.localSystemMailbox.Name, dictionary, utcNow); IL_238 :; } } } } }