예제 #1
0
 public FindMessageTrackingQuery(SmtpAddress proxyRecipient, string domain, DirectoryContext directoryContext, FindMessageTrackingReportRequestTypeWrapper request, ExchangeVersion minVersionRequested, TimeSpan timeout) : base(directoryContext.ClientContext, null, CasTraceEventType.MessageTracking, FindMessageTrackingApplication.MessageTrackingIOCompletion, InfoWorkerMessageTrackingPerformanceCounters.CurrentRequestDispatcherRequests)
 {
     if (SmtpAddress.Empty.Equals(proxyRecipient))
     {
         string address = ServerCache.Instance.GetOrgMailboxForDomain(domain).ToString();
         this.fakeRecipientQueryResults = MessageTrackingApplication.CreateFakeRecipientQueryResult(address);
     }
     else
     {
         this.proxyRecipient = proxyRecipient;
     }
     this.directoryContext    = directoryContext;
     this.request             = request;
     this.minVersionRequested = minVersionRequested;
     base.Timeout             = timeout;
 }
        public GetMessageTrackingQuery(SmtpAddress proxyRecipient, DirectoryContext directoryContext, GetMessageTrackingReportRequestTypeWrapper request, ExchangeVersion minVersionRequested, TimeSpan timeout) : base(directoryContext.ClientContext, null, CasTraceEventType.MessageTracking, GetMessageTrackingApplication.MessageTrackingIOCompletion, InfoWorkerMessageTrackingPerformanceCounters.CurrentRequestDispatcherRequests)
        {
            MessageTrackingReportId messageTrackingReportId = null;

            if (!MessageTrackingReportId.TryParse(request.WrappedRequest.MessageTrackingReportId, out messageTrackingReportId))
            {
                throw new ArgumentException("MessageTrackingReportId invalid");
            }
            this.directoryContext = directoryContext;
            string address = ServerCache.Instance.GetOrgMailboxForDomain(messageTrackingReportId.Domain).ToString();

            this.fakeRecipientQueryResults = MessageTrackingApplication.CreateFakeRecipientQueryResult(address);
            this.proxyRecipient            = proxyRecipient;
            this.request             = request;
            this.minVersionRequested = minVersionRequested;
            base.Timeout             = timeout;
        }
예제 #3
0
        internal static IList <RecipientData> CreateRecipientQueryResult(DirectoryContext directoryContext, DateTime queryPrepareDeadline, string proxyRecipient)
        {
            RecipientQuery recipientQuery = new RecipientQuery(directoryContext.ClientContext, directoryContext.TenantGalSession, queryPrepareDeadline, FindMessageTrackingQuery.RecipientProperties);

            Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress   emailAddress      = new Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress(string.Empty, proxyRecipient);
            Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress[] emailAddressArray = new Microsoft.Exchange.InfoWorker.Common.Availability.EmailAddress[]
            {
                emailAddress
            };
            IList <RecipientData> list = recipientQuery.Query(emailAddressArray);

            if (list[0].IsEmpty)
            {
                list = MessageTrackingApplication.CreateFakeRecipientQueryResult(ServerCache.Instance.GetOrgMailboxForDomain(emailAddress.Domain).ToString());
            }
            return(list);
        }