コード例 #1
0
ファイル: Pop3Client.cs プロジェクト: radtek/KoreCMS
        /// <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(e);
            }

            // Specifies that there must go some time between logins
            if (upper.Contains("[LOGIN-DELAY]"))
            {
                throw new LoginDelayException(e);
            }
        }
コード例 #2
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("Login denied because of recent connection to this maildrop. Increase time between connections.", innerException)
		{ }
コード例 #3
0
 ///<summary>
 /// Creates a PopServerLockedException with the given inner exception
 ///</summary>
 ///<param name="innerException">The exception that is the cause of this exception</param>
 public PopServerLockedException(PopServerException innerException)
     : base("The account is locked or in use", innerException)
 {
 }
コード例 #4
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("Login denied because of recent connection to this maildrop. Increase time between connections.", innerException)
 {
 }
コード例 #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)
 {
 }
コード例 #6
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)
		{ }
コード例 #7
0
 public PopServerLockedException(string message, PopServerException innerException) : base(message, innerException)
 {
 }
コード例 #8
0
 public PopServerLockedException(string message, PopServerException innerException) : base(message,innerException)
 {
 }
コード例 #9
0
		///<summary>
		/// Creates a PopServerLockedException with the given inner exception
		///</summary>
		///<param name="innerException">The exception that is the cause of this exception</param>
		public PopServerLockedException(PopServerException innerException)
			: base("The account is locked or in use", innerException)
		{ }