Example #1
0
 // Token: 0x060000E7 RID: 231 RVA: 0x000061B7 File Offset: 0x000043B7
 public static string ToStringParameterValue(Pop3SecurityMechanism securityMechanism)
 {
     if (securityMechanism == Pop3SecurityMechanism.None)
     {
         return(string.Empty);
     }
     return(securityMechanism.ToString());
 }
        // Token: 0x06000FA9 RID: 4009 RVA: 0x0003FDC0 File Offset: 0x0003DFC0
        private PopConnectionSettings BuildPopConnectionSettings(XElement settings)
        {
            Fqdn attributeValue  = GlobalConnectionSettingsProvider.GetAttributeValue <Fqdn>(settings, "in-serv", new Func <string, string, Fqdn>(GlobalConnectionSettingsProvider.ServerAttributeToFqdn));
            int  attributeValue2 = GlobalConnectionSettingsProvider.GetAttributeValue <int>(settings, "in-port", new Func <string, string, int>(GlobalConnectionSettingsProvider.ServerAttributeToInteger));
            Pop3SecurityMechanism attributeValue3 = GlobalConnectionSettingsProvider.GetAttributeValue <Pop3SecurityMechanism>(settings, "in-ssl", delegate(string attrName, string val)
            {
                if (!val.Equals("1", StringComparison.Ordinal))
                {
                    return(Pop3SecurityMechanism.None);
                }
                return(Pop3SecurityMechanism.Ssl);
            });

            return(new PopConnectionSettings(attributeValue, attributeValue2, Pop3AuthenticationMechanism.Basic, attributeValue3));
        }
Example #3
0
 public Pop3AuthenticationParameters(NetworkCredential networkCredential, Pop3AuthenticationMechanism pop3AuthenticationMechanism, Pop3SecurityMechanism pop3SecurityMechanism) : base(networkCredential)
 {
     this.Pop3AuthenticationMechanism = pop3AuthenticationMechanism;
     this.Pop3SecurityMechanism       = pop3SecurityMechanism;
 }
Example #4
0
 public Pop3AuthenticationParameters(string userName, SecureString userPassword, Pop3AuthenticationMechanism pop3AuthenticationMechanism, Pop3SecurityMechanism pop3SecurityMechanism) : base(userName, userPassword)
 {
     this.Pop3AuthenticationMechanism = pop3AuthenticationMechanism;
     this.Pop3SecurityMechanism       = pop3SecurityMechanism;
 }
        public static bool ValidatePopSettings(bool leaveOnServer, bool mirrored, string host, int port, string username, SecureString password, Pop3AuthenticationMechanism authentication, Pop3SecurityMechanism security, string userLegacyDN, ILog log, out LocalizedException validationException)
        {
            validationException = null;
            bool result2;

            using (IPop3Connection pop3Connection = Pop3Connection.CreateInstance(null))
            {
                Pop3ResultData result = pop3Connection.VerifyAccount();
                if (mirrored && !Pop3AutoProvision.SupportsMirroredSubscription(result))
                {
                    validationException = new Pop3MirroredAccountNotPossibleException();
                    result2             = false;
                }
                else if (leaveOnServer && !Pop3AutoProvision.SupportsLeaveOnServer(result))
                {
                    validationException = new Pop3LeaveOnServerNotPossibleException();
                    result2             = false;
                }
                else
                {
                    result2 = true;
                }
            }
            return(result2);
        }
 // Token: 0x06000F82 RID: 3970 RVA: 0x0003F444 File Offset: 0x0003D644
 public PopConnectionSettings(Fqdn serverName, int portNumber, Pop3AuthenticationMechanism authentication, Pop3SecurityMechanism security) : base(ConnectionSettingsType.Pop)
 {
     if (serverName == null)
     {
         throw new ArgumentNullException("serverName", "The serverName parameter cannot be null.");
     }
     if (portNumber < 0)
     {
         throw new ArgumentException("serverName", "The portNumber parameter must have a value greater than 0.");
     }
     this.ServerName     = serverName;
     this.Port           = portNumber;
     this.Authentication = authentication;
     this.Security       = security;
 }