protected override void InternalProcessRecord() { if (this.dashDashConnector && (this.DataObject.IsChanged(MailGatewaySchema.AddressSpaces) || this.DataObject.IsChanged(SmtpSendConnectorConfigSchema.SmartHostsString)) && !this.force && !base.ShouldContinue(Strings.ConfirmationMessageSetEdgeSyncSendConnectorAddressSpaceOrSmartHosts)) { return; } Exception ex = null; if (this.DataObject.DNSRoutingEnabled) { ex = NewSendConnector.CheckDNSAndSmartHostParameters(this.DataObject); if (ex == null) { ex = NewSendConnector.CheckDNSAndSmartHostAuthMechanismParameters(this.DataObject); } } if (ex == null) { ex = NewSendConnector.CheckTLSParameters(this.DataObject); } if (this.DataObject.TlsCertificateName != null) { ex = this.ValidateCertificateForSmtp(this.DataObject); } if (ex != null) { base.WriteError(ex, ErrorCategory.InvalidOperation, this.DataObject.Identity); return; } NewSendConnector.ClearSmartHostsListIfNecessary(this.DataObject); NewSendConnector.SetSmartHostAuthMechanismIfNecessary(this.DataObject); ManageSendConnectors.AdjustAddressSpaces(this.DataObject); base.InternalProcessRecord(); if (!TopologyProvider.IsAdamTopology()) { ManageSendConnectors.UpdateGwartLastModified((ITopologyConfigurationSession)base.DataSession, this.DataObject.SourceRoutingGroup, new ManageSendConnectors.ThrowTerminatingErrorDelegate(base.ThrowTerminatingError)); } }
protected override void InternalProcessRecord() { SmtpSendConnectorConfig dataObject = this.DataObject; if (!TopologyProvider.IsAdamTopology() && !dataObject.Enabled && !this.force && !base.ShouldContinue(Strings.ConfirmationMessageDisableSendConnector)) { return; } Exception ex = null; if (dataObject.DNSRoutingEnabled) { ex = NewSendConnector.CheckDNSAndSmartHostParameters(this.DataObject); if (ex == null) { ex = NewSendConnector.CheckDNSAndSmartHostAuthMechanismParameters(this.DataObject); } } if (ex == null) { ex = NewSendConnector.CheckTLSParameters(this.DataObject); } if (ex != null) { base.WriteError(ex, ErrorCategory.InvalidOperation, this.DataObject.Identity); return; } NewSendConnector.ClearSmartHostsListIfNecessary(this.DataObject); NewSendConnector.SetSmartHostAuthMechanismIfNecessary(this.DataObject); if (dataObject.IsScopedConnector) { ManageSendConnectors.AdjustAddressSpaces(dataObject); } base.InternalProcessRecord(); ITopologyConfigurationSession topologyConfigurationSession = (ITopologyConfigurationSession)base.DataSession; SmtpSendConnectorConfig smtpSendConnectorConfig = null; try { smtpSendConnectorConfig = topologyConfigurationSession.Read <SmtpSendConnectorConfig>(this.DataObject.OriginalId); } catch (LocalizedException exception) { base.WriteError(exception, ErrorCategory.ReadError, this.DataObject); return; } RawSecurityDescriptor originalSecurityDescriptor = smtpSendConnectorConfig.ReadSecurityDescriptor(); RawSecurityDescriptor rawSecurityDescriptor = null; try { rawSecurityDescriptor = this.ConfigureDefaultSecurityDescriptor(originalSecurityDescriptor); } catch (LocalizedException exception2) { base.WriteError(exception2, ErrorCategory.InvalidOperation, this.DataObject); return; } if (rawSecurityDescriptor != null) { topologyConfigurationSession.SaveSecurityDescriptor(this.DataObject.OriginalId, rawSecurityDescriptor); } if (!TopologyProvider.IsAdamTopology()) { ManageSendConnectors.UpdateGwartLastModified(topologyConfigurationSession, this.DataObject.SourceRoutingGroup, new ManageSendConnectors.ThrowTerminatingErrorDelegate(base.ThrowTerminatingError)); } }