Ejemplo n.º 1
0
        public DomainType GetAcceptedDomainType(string domain)
        {
            bool flag;
            AcceptedDomainCollection acceptedDomainCollection = this.GetAcceptedDomainCollection(this.OrganizationId, out flag);
            AcceptedDomainEntry      acceptedDomainEntry      = (AcceptedDomainEntry)acceptedDomainCollection.Find(domain);

            if (acceptedDomainEntry == null)
            {
                return(DomainType.External);
            }
            switch (acceptedDomainEntry.DomainType)
            {
            case AcceptedDomainType.Authoritative:
                return(DomainType.Authoritative);

            case AcceptedDomainType.ExternalRelay:
                return(DomainType.External);

            case AcceptedDomainType.InternalRelay:
                return(DomainType.InternalRelay);

            default:
                return(DomainType.Unknown);
            }
        }
Ejemplo n.º 2
0
        private bool IsInternal(string routingDomainStringRepr)
        {
            bool flag;
            AcceptedDomainCollection acceptedDomainCollection = this.getAcceptedDomainCollectionDelegate(this.organizationId, out flag);

            Microsoft.Exchange.Data.Transport.AcceptedDomain acceptedDomain = (acceptedDomainCollection != null) ? acceptedDomainCollection.Find(routingDomainStringRepr) : null;
            if (acceptedDomain != null && acceptedDomain.IsInCorporation)
            {
                bool flag2 = true;
                if (!flag)
                {
                    flag2 = (this.organizationId.Equals(OrganizationId.ForestWideOrgId) ? (acceptedDomain.TenantId == Guid.Empty) : (this.organizationId.ConfigurationUnit.ObjectGuid == acceptedDomain.TenantId));
                }
                if (flag2)
                {
                    return(true);
                }
            }
            RemoteDomainCollection remoteDomainCollection = this.getRemoteDomainCollectionDelegate(this.organizationId);
            RemoteDomain           remoteDomain           = (remoteDomainCollection != null) ? remoteDomainCollection.Find(routingDomainStringRepr) : null;

            return(remoteDomain != null && remoteDomain.IsInternal);
        }