Exemple #1
0
        private void GetCapa(Pop3Client client)
        {
            try
            {
                var capaParams = client.GetServerCapabilities();

                if (capaParams.Length <= 0) return;
                var index = Array.IndexOf(capaParams, "LOGIN-DELAY");
                if (index > -1)
                {
                    int delay;
                    if (int.TryParse(capaParams[index], NumberStyles.Integer, CultureInfo.InvariantCulture, out delay))
                        Account.ServerLoginDelay = delay;
                }

                _isUidlSupported = Array.IndexOf(capaParams, "UIDL") > -1;
            }
            catch
            { // CAPA NOT SUPPORTED 
                try
                { // CHECK UIDL SUPPORT
                    client.GetUniqueIds();
                    _isUidlSupported = true;
                }
                catch
                { // UIDL NOT SUPPORTED 
                    _isUidlSupported = false;
                }
            }
        }