classes/CIMAP.cpp
void CIMAP::sendCommandIDLE(const std::string &commandLine)
    {
        std::string response;
        sendIMAPCommand(commandLine);
        waitForIMAPCommandResponse(kContinuation, m_commandResponse);
        if (!m_commandResponse.empty())
        {
            waitForIMAPCommandResponse(kUntagged, response);
            if (!response.empty())
            {
                sendIMAPCommand(static_cast<std::string>(kDONE) + kEOL);
                waitForIMAPCommandResponse(m_currentTag, m_commandResponse);
                if (!m_commandResponse.empty())
                {
                    response += m_commandResponse;
                    m_commandResponse = response;
                }
            }
            else
            {
                m_commandResponse.clear();
            }
        }
    }
//
// Send IDLE command (requires a special handler). When IDLE is sent it then waits
// for a '+' from the server. Here it knows to wait for an un-tagged response where
// upon it sends "DONE" and waits for the final tagged IDLE response. Note: The
// un-tagged response before "DONE" sent is saved and placed onto the front of
// the final IDLE response. Any response that is empty signals a server disconnect
// so stop processing and pass up.
//

Send IDLE command (requires a special handler). When IDLE is sent it then waits
for a '+' from the server. Here it knows to wait for an un-tagged response where
upon it sends "DONE" and waits for the final tagged IDLE response. Note: The
un-tagged response before "DONE" sent is saved and placed onto the front of
the final IDLE response. Any response that is empty signals a server disconnect
so stop processing and pass up.
Send IDLE command ( requires a special handler ) . When IDLE is sent it then waits for a ' + ' from the server . Here it knows to wait for an un - tagged response where upon it sends " DONE " and waits for the final tagged IDLE response . Note : The un - tagged response before " DONE " sent is saved and placed onto the front of the final IDLE response . Any response that is empty signals a server disconnect so stop processing and pass up .
void CIMAP::sendCommandIDLE(const std::string &commandLine)
    {
        std::string response;
        sendIMAPCommand(commandLine);
        waitForIMAPCommandResponse(kContinuation, m_commandResponse);
        if (!m_commandResponse.empty())
        {
            waitForIMAPCommandResponse(kUntagged, response);
            if (!response.empty())
            {
                sendIMAPCommand(static_cast<std::string>(kDONE) + kEOL);
                waitForIMAPCommandResponse(m_currentTag, m_commandResponse);
                if (!m_commandResponse.empty())
                {
                    response += m_commandResponse;
                    m_commandResponse = response;
                }
            }
            else
            {
                m_commandResponse.clear();
            }
        }
    }
void CIMAP :: sendCommandIDLE ( const std :: string & commandLine ) { std :: string response ; sendIMAPCommand ( commandLine ) ; waitForIMAPCommandResponse ( kContinuation , m_commandResponse ) ; if ( ! m_commandResponse . empty ( ) ) { waitForIMAPCommandResponse ( kUntagged , response ) ; if ( ! response . empty ( ) ) { sendIMAPCommand ( static_cast < std :: string > ( kDONE ) + kEOL ) ; waitForIMAPCommandResponse ( m_currentTag , m_commandResponse ) ; if ( ! m_commandResponse . empty ( ) ) { response += m_commandResponse ; m_commandResponse = response ; } } else { m_commandResponse . clear ( ) ; } } }
Send IDLE command (requires a special handler).
Send IDLE command ( requires a special handler ) .