#include "__IMAP_LOGOUT.h" #include "IMAPServer.h" namespace mail { // RFC 3501 6.1.3: LOGOUT MUST be supported in every connection // state, replies with an untagged BYE then a tagged OK, and closes // the connection - previously not registered at all, so a client // had no clean way to end a session. terminate() (inherited from // TCPSession) defers the actual close until after this response has // gone out - TCPSession::onLineReceived() calls send() before // checking the term flag. int __IMAP_LOGOUT::processCommand(coreutils::ZString &request, IMAPSession &session, IMAPServer &server) { session.out << "* BYE IMAP4rev1 Server logging out" << CRLF; session.out << session.tag << " OK LOGOUT completed" << CRLF; session.terminate(); return 1; } }