Beispiel #1
0
        protected void Capability()
        {
            IList<string> data = new List<string>();

            if (SendAndReceive(ImapCommands.Capability, ref data) && data.Count > 0)
            {
                Capabilities = new Capability(data[0]);
            }
        }
        public bool Login(ImapCredentials credentials)
        {
            Credentials = credentials;
            IList<string> data = new List<string>();
            IsAuthenticated = SendAndReceive(credentials.ToCommand(Capabilities), ref data, credentials, null, true);

            var capabilities = data.FirstOrDefault(_ => _.StartsWith("* CAPABILITY"));

            if (Capabilities == null)
            {
                Capabilities = new Capability(capabilities);
            }
            else
            {
                Capabilities.Update(capabilities);
            }

            if (IsAuthenticated && Host.ToLower() == "imap.qq.com")
            {
                Behavior.SearchAllNotSupported = true;
                Behavior.LazyFolderBrowsingNotSupported = true;
            }

            return IsAuthenticated;
        }