Exemple #1
0
        public static bool IsExternalPartner(RoutingAddress routingAddress, OrganizationId organizationId)
        {
            if (organizationId == null)
            {
                throw new ArgumentNullException("emailAddress");
            }
            if (string.IsNullOrEmpty(routingAddress.DomainPart))
            {
                throw new ArgumentException(string.Format("routingAddress.DomainPart is null or empty for the routingaddress:{0}.", routingAddress));
            }
            OwaPerTenantTransportSettings owaPerTenantTransportSettings = ADCacheUtils.GetOwaPerTenantTransportSettings(organizationId);

            return(owaPerTenantTransportSettings.IsTLSSendSecureDomain(routingAddress.DomainPart));
        }
Exemple #2
0
        public static bool IsInternal(RoutingAddress routingAddress, OrganizationId organizationId)
        {
            if (organizationId == null)
            {
                throw new ArgumentNullException("organizationId");
            }
            if (string.IsNullOrEmpty(routingAddress.DomainPart))
            {
                throw new ArgumentException(string.Format("routingAddress.DomainPart is null or empty for the routingaddress:{0}.", routingAddress));
            }
            OwaPerTenantAcceptedDomains owaPerTenantAcceptedDomains = ADCacheUtils.GetOwaPerTenantAcceptedDomains(organizationId);
            OwaPerTenantRemoteDomains   owaPerTenantRemoteDomains   = ADCacheUtils.GetOwaPerTenantRemoteDomains(organizationId);
            IsInternalResolver          isInternalResolver          = new IsInternalResolver(organizationId, new IsInternalResolver.GetAcceptedDomainCollectionDelegate(owaPerTenantAcceptedDomains.GetAcceptedDomainMap), new IsInternalResolver.GetRemoteDomainCollectionDelegate(owaPerTenantRemoteDomains.GetRemoteDomainMap));

            return(isInternalResolver.IsInternal(new RoutingDomain(routingAddress.DomainPart)));
        }