public ISendConnector NewSendConnector(ISendConnector configuration) { SessionParameters parameters = this.SetSendConnectorParameters(configuration); SmtpSendConnectorConfig smtpSendConnectorConfig = base.RemotePowershellSession.RunOneCommandSingleResult <SmtpSendConnectorConfig>("New-SendConnector", parameters, false); if (smtpSendConnectorConfig != null) { return(new Microsoft.Exchange.Management.Hybrid.Entity.SendConnector(smtpSendConnectorConfig)); } return(null); }
public SendConnector(SmtpSendConnectorConfig sc) { this.Identity = (ADObjectId)sc.Identity; this.Name = sc.Name; this.AddressSpaces = sc.AddressSpaces; this.SourceTransportServers = sc.SourceTransportServers; this.DNSRoutingEnabled = sc.DNSRoutingEnabled; this.SmartHosts = sc.SmartHosts; this.RequireTLS = sc.RequireTLS; this.TlsAuthLevel = sc.TlsAuthLevel; this.TlsDomain = TaskCommon.ToStringOrNull(sc.TlsDomain); this.ErrorPolicies = sc.ErrorPolicies; this.TlsCertificateName = sc.TlsCertificateName; this.CloudServicesMailEnabled = sc.CloudServicesMailEnabled; this.Fqdn = TaskCommon.ToStringOrNull(sc.Fqdn); }
protected List <SmtpAddress> GetSiteEgressCrossPremiseTargets(IList <SmtpAddress> crossPremiseTargets, IList <SmtpSendConnectorConfig> sendConnectors, IList <SmtpSendConnectorConfig> siteSendConnectors) { List <SmtpAddress> list = new List <SmtpAddress>(); foreach (SmtpAddress item in crossPremiseTargets) { string text = null; int num = int.MaxValue; SmtpSendConnectorConfig smtpSendConnectorConfig = null; foreach (SmtpSendConnectorConfig smtpSendConnectorConfig2 in sendConnectors) { if (smtpSendConnectorConfig2.Enabled) { foreach (AddressSpace addressSpace in smtpSendConnectorConfig2.AddressSpaces) { if (addressSpace.IsSmtpType && (addressSpace.DomainWithSubdomains.Match(item.Domain) > 0 || addressSpace.DomainWithSubdomains.IsStar)) { if (text == null || text.Length < addressSpace.Domain.Length) { text = addressSpace.Domain; num = addressSpace.Cost; smtpSendConnectorConfig = smtpSendConnectorConfig2; } else if (text.Length == addressSpace.Domain.Length && (siteSendConnectors.Contains(smtpSendConnectorConfig2) || (!siteSendConnectors.Contains(smtpSendConnectorConfig) && num > addressSpace.Cost))) { text = addressSpace.Domain; num = addressSpace.Cost; smtpSendConnectorConfig = smtpSendConnectorConfig2; } } } } } if (smtpSendConnectorConfig != null && siteSendConnectors.Contains(smtpSendConnectorConfig)) { list.Add(item); } } return(list); }
// Token: 0x060003B6 RID: 950 RVA: 0x0001573C File Offset: 0x0001393C internal static ADObject CreateAndInitializeConfigObject <TConfigObject>(ADPropertyBag propertyBag, ADRawEntry dummyObject, IDirectorySession directorySession) where TConfigObject : IConfigurable, new() { ArgumentValidator.ThrowIfNull("propertyBag", propertyBag); MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)propertyBag[ADObjectSchema.ObjectClass]; ADObject adobject; if (dummyObject is MiniTopologyServer) { adobject = new MiniTopologyServer(); } else if (dummyObject is MiniVirtualDirectory) { adobject = new MiniVirtualDirectory(); } else if (dummyObject is MiniEmailTransport) { adobject = new MiniEmailTransport(); } else if (dummyObject is MiniReceiveConnector) { adobject = new MiniReceiveConnector(); } else if (multiValuedProperty.Contains(ADWebServicesVirtualDirectory.MostDerivedClass)) { adobject = new ADWebServicesVirtualDirectory(); } else if (multiValuedProperty.Contains(ADE12UMVirtualDirectory.MostDerivedClass)) { adobject = new ADE12UMVirtualDirectory(); } else if (multiValuedProperty.Contains("msExchMobileVirtualDirectory")) { adobject = new ADMobileVirtualDirectory(); } else if (multiValuedProperty.Contains(ADOwaVirtualDirectory.MostDerivedClass)) { adobject = new ADOwaVirtualDirectory(); } else if (multiValuedProperty.Contains(ADRpcHttpVirtualDirectory.MostDerivedClass)) { adobject = new ADRpcHttpVirtualDirectory(); } else if (multiValuedProperty.Contains(ADMapiVirtualDirectory.MostDerivedClass)) { adobject = new ADMapiVirtualDirectory(); } else if (multiValuedProperty.Contains(ADAvailabilityForeignConnectorVirtualDirectory.MostDerivedClass)) { adobject = new ADAvailabilityForeignConnectorVirtualDirectory(); } else if (multiValuedProperty.Contains(ADOabVirtualDirectory.MostDerivedClass)) { adobject = new ADOabVirtualDirectory(); } else if (multiValuedProperty.Contains(ADEcpVirtualDirectory.MostDerivedClass)) { adobject = new ADEcpVirtualDirectory(); } else if (multiValuedProperty.Contains(Pop3AdConfiguration.MostDerivedClass)) { adobject = new Pop3AdConfiguration(); } else if (multiValuedProperty.Contains(Imap4AdConfiguration.MostDerivedClass)) { adobject = new Imap4AdConfiguration(); } else if (multiValuedProperty.Contains("mailGateway")) { if (multiValuedProperty.Contains(SmtpSendConnectorConfig.MostDerivedClass)) { adobject = new SmtpSendConnectorConfig(); } else if (multiValuedProperty.Contains(DeliveryAgentConnector.MostDerivedClass)) { adobject = new DeliveryAgentConnector(); } else if (propertyBag.Contains(ForeignConnectorSchema.DropDirectory)) { adobject = new ForeignConnector(); } else { adobject = new LegacyGatewayConnector(); } } else if (multiValuedProperty.Contains("msExchEdgeSyncEhfConnector")) { adobject = new EdgeSyncEhfConnector(); } else { if (!multiValuedProperty.Contains("msExchEdgeSyncMservConnector")) { return(ADObjectFactory.CreateAndInitializeObject <TConfigObject>(propertyBag, directorySession)); } adobject = new EdgeSyncMservConnector(); } adobject.m_Session = directorySession; adobject.propertyBag = propertyBag; adobject.Initialize(); adobject.ResetChangeTracking(true); if (directorySession != null) { adobject.SetIsReadOnly(directorySession.ReadOnly); } return(adobject); }
// Token: 0x06005358 RID: 21336 RVA: 0x0013082E File Offset: 0x0012EA2E public DefaultToInternetSendConnector(SmtpSendConnectorConfig connector) : base(connector) { this.connector = connector; }