///<summary>
		/// Creates a LoginDelayException with the given inner exception
		///</summary>
		///<param name="innerException">The exception that is the cause of this exception</param>
		public LoginDelayException(PopServerException innerException)
			: base("The account is locked or in use", innerException)
		{ }
        public InvalidLoginException(string message, PopServerException innerException)
            : base(message, innerException)
        {

        }
Ejemplo n.º 3
0
 public InvalidLoginException(string message, PopServerException innerException)
     : base(message, innerException)
 {
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Checks for extra response codes when an authentication has failed and throws
        /// the correct exception.
        /// If no such response codes is found, nothing happens.
        /// </summary>
        /// <param name="serverErrorResponse">The server response string</param>
        /// <param name="e">The exception thrown because the server responded with -ERR</param>
        /// <exception cref="PopServerLockedException">If the account is locked or in use</exception>
        /// <exception cref="LoginDelayException">If the server rejects the login because of too recent logins</exception>
        private static void CheckFailedLoginServerResponse(string serverErrorResponse, PopServerException e)
        {
            string upper = serverErrorResponse.ToUpperInvariant();

            // Bracketed strings are extra response codes addded
            // in RFC http://tools.ietf.org/html/rfc2449
            // together with the CAPA command.

            // Specifies the account is in use
            if (upper.Contains("[IN-USE]") || upper.Contains("LOCK"))
            {
                throw new PopServerLockedException("Authentication: maildrop is locked or in-use", e);
            }

            // Specifies that there must go some time between logins
            if (upper.Contains("[LOGIN-DELAY]"))
            {
                throw new LoginDelayException(e);
            }
        }
Ejemplo n.º 5
0
 ///<summary>
 /// Creates a LoginDelayException with the given inner exception
 ///</summary>
 ///<param name="innerException">The exception that is the cause of this exception</param>
 public LoginDelayException(PopServerException innerException)
     : base("The account is locked or in use", innerException)
 {
 }