protected override void HandleNonAuthoritativeDomains(EmailAddressPolicy policy, HashSet <SmtpDomain> domains) { ProxyAddressTemplateCollection proxyAddressTemplateCollection = new ProxyAddressTemplateCollection(); foreach (ProxyAddressTemplate proxyAddressTemplate in policy.NonAuthoritativeDomains) { SmtpDomain smtpDomain; if (!UpdateEmailAddressPolicy.DomainValidator.TryGetDomain(proxyAddressTemplate, out smtpDomain)) { proxyAddressTemplateCollection.Add(proxyAddressTemplate); } } bool flag = false; foreach (SmtpDomain smtpDomain2 in domains) { SmtpProxyAddressTemplate item = new SmtpProxyAddressTemplate("@" + smtpDomain2.Domain, false); proxyAddressTemplateCollection.Add(item); if (!flag && !policy.NonAuthoritativeDomains.Contains(item)) { flag = true; } } if (!flag) { flag = (proxyAddressTemplateCollection.Count != policy.NonAuthoritativeDomains.Count); } if (flag) { UpdateEmailAddressPolicy.CheckEapVersion(policy); policy.NonAuthoritativeDomains = proxyAddressTemplateCollection; } }
protected override void HandleNonAuthoritativeDomains(EmailAddressPolicy policy, HashSet <SmtpDomain> domains) { ProxyAddressTemplateCollection proxyAddressTemplateCollection = new ProxyAddressTemplateCollection(); foreach (ProxyAddressTemplate proxyAddressTemplate in policy.NonAuthoritativeDomains) { SmtpDomain template; if (!UpdateEmailAddressPolicy.DomainValidator.TryGetDomain(proxyAddressTemplate, out template) || (!SetAcceptedDomain.DomainEditValidator.Conflict(this.newDomain, template) && !SetAcceptedDomain.DomainEditValidator.Conflict(this.oldDomain, template))) { proxyAddressTemplateCollection.Add(proxyAddressTemplate); } } foreach (SmtpDomain smtpDomain in domains) { if (SetAcceptedDomain.DomainEditValidator.Conflict(this.newDomain, smtpDomain) || SetAcceptedDomain.DomainEditValidator.Conflict(this.oldDomain, smtpDomain)) { SmtpProxyAddressTemplate item = new SmtpProxyAddressTemplate("@" + smtpDomain.Domain, false); proxyAddressTemplateCollection.Add(item); } } UpdateEmailAddressPolicy.CheckEapVersion(policy); policy.NonAuthoritativeDomains = proxyAddressTemplateCollection; this.session.Save(policy); }