/***************************************************************************
                         SP Mail project : Simple Powerful Mail
                          CImapAccount.cpp  -  description
                             -------------------
    begin                : 23 June 2003
    copyright            : (C) 2000-2006 by Alexey S.Parshin
    email                : alexeyp@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include <stdio.h>
#include "CImapAccount.h"

using namespace std;

CImapAccount::CImapAccount(string name,string host,string user,string password) {
   m_name = name;
   this->host(host);
   m_ds.host(host);
   m_ds.user(user);
   m_ds.password(password);
}

void CImapAccount::login() {
   cmd_login(m_ds.user(),m_ds.password());
}

void CImapAccount::logout() {
   cmd_logout();
   close();
}

void CImapAccount::loadFolders() {
   login();
   cmd_list("*",true);
   m_folders = response();
   logout();
}
