Exemplo n.º 1
0
        static MiniReceiveConnector()
        {
            ReceiveConnector receiveConnector = new ReceiveConnector();

            MiniReceiveConnector.mostDerivedClass = receiveConnector.MostDerivedObjectClass;
            MiniReceiveConnector.schema           = ObjectSchema.GetInstance <MiniReceiveConnectorSchema>();
        }
Exemplo n.º 2
0
        public HttpResponseMessage Put(int id, [FromBody] ReceiveConnector ReceiveConnector)
        {
            var updated = _service.UpdateReceiveConnector(ReceiveConnector);

            if (updated == null)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Could not update Receive connector."));
            }

            return(Request.CreateResponse(HttpStatusCode.OK, updated));
        }
Exemplo n.º 3
0
        public HttpResponseMessage Post([FromBody] ReceiveConnector ReceiveConnector)
        {
            var added = _service.AddReceiveConnector(ReceiveConnector);

            if (added == null)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Could not add Receive connector."));
            }

            return(Request.CreateResponse(HttpStatusCode.OK, added));
        }
        internal static SmtpConnectivityStatus GetStatus(Server server, ReceiveConnector connector, IPBinding binding, IPEndPoint endPoint)
        {
            SmtpConnectivityStatusCode statusCode;
            string details;

            TestSmtpConnectivity.TestEndPoint(endPoint, out statusCode, out details);
            return(new SmtpConnectivityStatus(server, connector, binding, endPoint)
            {
                StatusCode = statusCode,
                Details = details
            });
        }
        public SmtpConnectivityStatus(Server server, ReceiveConnector receiveConnector, IPBinding binding, IPEndPoint endPoint) : base(new SimpleProviderPropertyBag())
        {
            string text     = binding.ToString();
            string text2    = endPoint.ToString();
            string identity = string.Format("{0}\\{1}\\{2}", new object[]
            {
                receiveConnector.Identity,
                text,
                text2,
                CultureInfo.CurrentUICulture
            });

            this[this.propertyBag.ObjectIdentityPropertyDefinition] = new ConfigObjectId(identity);
            this.Server           = server.Name;
            this.ReceiveConnector = receiveConnector.Name;
            this.Binding          = text;
            this.EndPoint         = text2;
        }
Exemplo n.º 6
0
 public static bool Verify(ReceiveConnector connector, Server server, out LocalizedException exception)
 {
     if (connector == null)
     {
         throw new ArgumentNullException("connector");
     }
     if (server == null)
     {
         throw new ArgumentNullException("server");
     }
     exception = null;
     if (server.Fqdn.Equals(connector.Fqdn, StringComparison.InvariantCultureIgnoreCase))
     {
         return(true);
     }
     if (server.Name.Equals(connector.Fqdn, StringComparison.InvariantCultureIgnoreCase))
     {
         return(true);
     }
     exception = new InvalidFqdnUnderExchangeServerAuthException(server.Fqdn, server.Name);
     return(false);
 }
 // Token: 0x06000B43 RID: 2883 RVA: 0x000240B4 File Offset: 0x000222B4
 public ReceiveConnectorIdParameter(ReceiveConnector connector) : base(connector.Id)
 {
 }
Exemplo n.º 8
0
 public ReceiveConnector UpdateReceiveConnector(ReceiveConnector connector)
 {
     return(_receiveConnectors.Update(connector).ConvertTo <ReceiveConnector>());
 }
Exemplo n.º 9
0
 public ReceiveConnector AddReceiveConnector(ReceiveConnector connector)
 {
     return(_receiveConnectors.Add(connector).ConvertTo <ReceiveConnector>());
 }
Exemplo n.º 10
0
 public ReceiveConnector UpdateReceiveConnector(ReceiveConnector connector)
 {
     return(Channel.UpdateReceiveConnector(connector));
 }
Exemplo n.º 11
0
 public ReceiveConnector AddReceiveConnector(ReceiveConnector connector)
 {
     return(Channel.AddReceiveConnector(connector));
 }
Exemplo n.º 12
0
        public static bool Verify(ReceiveConnector connectorBeingAddedOrEdited, IConfigurationSession session, out LocalizedException exception)
        {
            ArgumentValidator.ThrowIfNull("connectorBeginAddedOrEdited", connectorBeingAddedOrEdited);
            ArgumentValidator.ThrowIfNull("session", session);
            IEnumerable <ReceiveConnector> enumerable = session.Find <ReceiveConnector>(connectorBeingAddedOrEdited.Id.Parent, QueryScope.OneLevel, null, null, 0);

            foreach (ReceiveConnector receiveConnector in enumerable)
            {
                if (!connectorBeingAddedOrEdited.Identity.Equals(receiveConnector.Identity))
                {
                    bool flag  = false;
                    bool flag2 = false;
                    foreach (IPBinding ipbinding in connectorBeingAddedOrEdited.Bindings)
                    {
                        if (flag2)
                        {
                            break;
                        }
                        foreach (IPBinding ipbinding2 in receiveConnector.Bindings)
                        {
                            if (ipbinding.Equals(ipbinding2))
                            {
                                flag  = true;
                                flag2 = true;
                                break;
                            }
                            if (ipbinding.AddressFamily == ipbinding2.AddressFamily)
                            {
                                if ((ipbinding.Address.Equals(IPAddress.Any) || ipbinding2.Address.Equals(IPAddress.Any)) && ipbinding.Port.Equals(ipbinding2.Port))
                                {
                                    flag2 = true;
                                    break;
                                }
                                if ((ipbinding.Address.Equals(IPAddress.IPv6Any) || ipbinding2.Address.Equals(IPAddress.IPv6Any)) && ipbinding.Port.Equals(ipbinding2.Port))
                                {
                                    flag2 = true;
                                    break;
                                }
                            }
                        }
                    }
                    if (flag2)
                    {
                        if (connectorBeingAddedOrEdited.TransportRole != receiveConnector.TransportRole)
                        {
                            exception = new ReceiveConnectorRoleConflictException(receiveConnector.Id.ToString());
                            return(false);
                        }
                        if (flag)
                        {
                            if (ReceiveConnectorNoMappingConflictCondition.PartiallyOverlapOrEqual(connectorBeingAddedOrEdited.RemoteIPRanges, receiveConnector.RemoteIPRanges))
                            {
                                exception = new ConnectorMappingConflictException(receiveConnector.Id.ToString());
                                return(false);
                            }
                        }
                        else if (ReceiveConnectorNoMappingConflictCondition.PartiallyOverlap(connectorBeingAddedOrEdited.RemoteIPRanges, receiveConnector.RemoteIPRanges))
                        {
                            exception = new ConnectorMappingConflictException(receiveConnector.Id.ToString());
                            return(false);
                        }
                    }
                }
            }
            exception = null;
            return(true);
        }