/// <summary> /// Reset the connection state. /// </summary> private void Rset(Pop3Context context) { if (context.LastCommand != -1) { if (context != null && !String.IsNullOrEmpty(context.Username)) { IMailStorage mail = (_storage != null ? _storage as IMailStorage : null); if (mail != null) { mail.Logout(context.Username); } } context.Reset(); context.Username = null; context.Password = null; context.LastCommand = -1; context.WriteLine(MESSAGE_OK); } else { context.WriteLine(MESSAGE_INVALID_COMMAND_ORDER); } }