// Token: 0x06000088 RID: 136 RVA: 0x000045C4 File Offset: 0x000027C4 public static bool DoesEmailAddressReferenceArchive(ADRecipient recipient, string emailAddress) { bool result = false; Guid g; if (AutodiscoverCommonUserSettings.TryGetExchangeGuidFromEmailAddress(emailAddress, out g) && (recipient.RecipientType == RecipientType.MailUser || recipient.RecipientType == RecipientType.UserMailbox)) { ADUser aduser = (ADUser)recipient; if (aduser.ArchiveGuid.Equals(g)) { result = true; } } return(result); }
protected void ResolveRequestedADRecipient() { string resolveMethod = "Unknown"; try { if (this.Caller != null) { if (!string.IsNullOrEmpty(this.RequestData.LegacyDN) && string.Equals(this.Caller.LegacyExchangeDN, this.RequestData.LegacyDN, StringComparison.OrdinalIgnoreCase)) { this.RequestedRecipient = this.Caller; resolveMethod = "CallerByLegacyDN"; return; } if (!string.IsNullOrEmpty(this.RequestData.LegacyDN) && this.Caller.EmailAddresses != null) { string x500 = "x500:" + this.RequestData.LegacyDN; ProxyAddress a = this.Caller.EmailAddresses.Find((ProxyAddress x) => string.Equals(x.ToString(), x500, StringComparison.OrdinalIgnoreCase)); if (a != null) { this.RequestedRecipient = this.Caller; resolveMethod = "CallerByX500"; return; } } if (!string.IsNullOrEmpty(this.RequestData.EMailAddress) && SmtpAddress.IsValidSmtpAddress(this.RequestData.EMailAddress)) { SmtpProxyAddress smtpProxy = new SmtpProxyAddress(this.RequestData.EMailAddress, true); ProxyAddress a2 = this.Caller.EmailAddresses.Find((ProxyAddress x) => x.Equals(smtpProxy)); if (a2 != null) { this.RequestedRecipient = this.Caller; resolveMethod = "CallerByProxy"; return; } } if (AutodiscoverCommonUserSettings.HasLocalArchive(this.Caller) && AutodiscoverCommonUserSettings.IsEmailAddressTargetingArchive(this.Caller as ADUser, this.RequestData.EMailAddress)) { this.RequestedRecipient = this.Caller; resolveMethod = "CallerByArchive"; return; } } if (this.Caller == null) { if (VariantConfiguration.InvariantNoFlightingSnapshot.Autodiscover.NoADLookupForUser.Enabled) { goto IL_285; } } try { RequestDetailsLoggerBase <RequestDetailsLogger> .Current.TrackLatency(ServiceLatencyMetadata.RequestedUserADLatency, delegate() { IRecipientSession callerScopedRecipientSession = this.GetCallerScopedRecipientSession(); if (!string.IsNullOrEmpty(this.RequestData.LegacyDN)) { this.RequestedRecipient = callerScopedRecipientSession.FindByLegacyExchangeDN(this.RequestData.LegacyDN); if (this.RequestedRecipient != null) { resolveMethod = "FoundByLegacyDN"; } } if (this.RequestedRecipient == null && this.RequestData.EMailAddress != null && SmtpAddress.IsValidSmtpAddress(this.RequestData.EMailAddress)) { Guid guid; if (AutodiscoverCommonUserSettings.TryGetExchangeGuidFromEmailAddress(this.RequestData.EMailAddress, out guid)) { this.RequestedRecipient = callerScopedRecipientSession.FindByExchangeGuidIncludingArchive(guid); ADUser aduser = this.RequestedRecipient as ADUser; if (aduser != null && aduser.ArchiveGuid.Equals(guid) && RemoteMailbox.IsRemoteMailbox(aduser.RecipientTypeDetails) && aduser.ArchiveDatabase == null) { this.RequestedRecipient = null; } if (this.RequestedRecipient != null) { resolveMethod = "FoundByGUID"; } } if (this.RequestedRecipient == null) { SmtpProxyAddress proxyAddress = new SmtpProxyAddress(this.RequestData.EMailAddress, true); this.RequestedRecipient = callerScopedRecipientSession.FindByProxyAddress(proxyAddress); if (this.RequestedRecipient != null) { resolveMethod = "FoundBySMTP"; } } } }); } catch (LocalizedException ex) { ExTraceGlobals.FrameworkTracer.TraceError <string, string>(0L, "[UpdateCacheCallback()] 'LocalizedException' Message=\"{0}\";StackTrace=\"{1}\"", ex.Message, ex.StackTrace); Common.EventLog.LogEvent(AutodiscoverEventLogConstants.Tuple_ErrWebException, Common.PeriodicKey, new object[] { ex.Message, ex.StackTrace }); resolveMethod = "Exception"; } IL_285 :; } finally { RequestDetailsLoggerBase <RequestDetailsLogger> .Current.AppendGenericInfo("ResolveMethod", resolveMethod); } }