diff --git a/BMAMail b/BMAMail index cb9baaa..a337acf 100755 Binary files a/BMAMail and b/BMAMail differ diff --git a/IMAPCommand.h b/IMAPCommand.h index 1eb4aea..d2c4aec 100644 --- a/IMAPCommand.h +++ b/IMAPCommand.h @@ -12,7 +12,7 @@ namespace mail { public: virtual int processCommand(std::string request, core::TCPSession *session, std::stringstream &data) override; - virtual int processCommand(coreutils::PString request, IMAPSession &session, IMAPServer &server, std::stringstream &data) {} + virtual int processCommand(coreutils::PString request, IMAPSession &session, IMAPServer &server, std::stringstream &data) { return 0; } }; diff --git a/POP3Command.h b/POP3Command.h index 2918e2d..dad6a6f 100644 --- a/POP3Command.h +++ b/POP3Command.h @@ -15,7 +15,9 @@ namespace mail { return processCommand(parser, (POP3Session &)*session, data); } - virtual int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) {} + virtual int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { + return 0; + } }; diff --git a/SMTPCommand.h b/SMTPCommand.h index 6e0511c..238c55b 100644 --- a/SMTPCommand.h +++ b/SMTPCommand.h @@ -12,7 +12,9 @@ namespace mail { public: virtual int processCommand(std::string request, core::TCPSession *session, std::stringstream &data) override; - virtual int processCommand(coreutils::PString request, SMTPSession &session, SMTPServer &server, std::stringstream &data) {} + virtual int processCommand(coreutils::PString request, SMTPSession &session, SMTPServer &server, std::stringstream &data) { + return 0; + } }; diff --git a/__IMAP_APPEND.cpp b/__IMAP_APPEND.cpp index 3df9438..790639a 100644 --- a/__IMAP_APPEND.cpp +++ b/__IMAP_APPEND.cpp @@ -4,6 +4,7 @@ namespace mail { int __IMAP_APPEND::processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } } diff --git a/__IMAP_APPEND.h b/__IMAP_APPEND.h index cb37beb..8bdd6df 100644 --- a/__IMAP_APPEND.h +++ b/__IMAP_APPEND.h @@ -9,7 +9,7 @@ namespace mail { class __IMAP_APPEND : public IMAPCommand { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data); - + }; } diff --git a/__IMAP_AUTHENTICATE.h b/__IMAP_AUTHENTICATE.h index a83f3c5..8a18e47 100644 --- a/__IMAP_AUTHENTICATE.h +++ b/__IMAP_AUTHENTICATE.h @@ -11,6 +11,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_CHECK.h b/__IMAP_CHECK.h index 52d9194..46b9a8d 100644 --- a/__IMAP_CHECK.h +++ b/__IMAP_CHECK.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_CLOSE.h b/__IMAP_CLOSE.h index ba9eaa3..f9f4d3b 100644 --- a/__IMAP_CLOSE.h +++ b/__IMAP_CLOSE.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_COPY.h b/__IMAP_COPY.h index bf83189..94da1d7 100644 --- a/__IMAP_COPY.h +++ b/__IMAP_COPY.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_CREATE.h b/__IMAP_CREATE.h index ca6c007..07ad232 100644 --- a/__IMAP_CREATE.h +++ b/__IMAP_CREATE.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_DELETE.h b/__IMAP_DELETE.h index 2ef78de..c3a9d97 100644 --- a/__IMAP_DELETE.h +++ b/__IMAP_DELETE.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_EXAMINE.h b/__IMAP_EXAMINE.h index 2d2795c..e9919dc 100644 --- a/__IMAP_EXAMINE.h +++ b/__IMAP_EXAMINE.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_EXPUNGE.h b/__IMAP_EXPUNGE.h index 2fb5b25..5f27401 100644 --- a/__IMAP_EXPUNGE.h +++ b/__IMAP_EXPUNGE.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_FETCH.h b/__IMAP_FETCH.h index b2e15c5..794fa72 100644 --- a/__IMAP_FETCH.h +++ b/__IMAP_FETCH.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_LIST.h b/__IMAP_LIST.h index 9122240..cfa7778 100644 --- a/__IMAP_LIST.h +++ b/__IMAP_LIST.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_LOGIN.h b/__IMAP_LOGIN.h index 582edcf..ba250b7 100644 --- a/__IMAP_LOGIN.h +++ b/__IMAP_LOGIN.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_LSUB.h b/__IMAP_LSUB.h index 1282085..601f624 100644 --- a/__IMAP_LSUB.h +++ b/__IMAP_LSUB.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_RENAME.h b/__IMAP_RENAME.h index 20e57cb..59742da 100644 --- a/__IMAP_RENAME.h +++ b/__IMAP_RENAME.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_SEARCH.h b/__IMAP_SEARCH.h index 9520c3d..e0b823b 100644 --- a/__IMAP_SEARCH.h +++ b/__IMAP_SEARCH.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_SELECT.h b/__IMAP_SELECT.h index 9cb7de5..31de587 100644 --- a/__IMAP_SELECT.h +++ b/__IMAP_SELECT.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_STARTTLS.h b/__IMAP_STARTTLS.h index 60a58f5..7851f84 100644 --- a/__IMAP_STARTTLS.h +++ b/__IMAP_STARTTLS.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_STATUS.h b/__IMAP_STATUS.h index b226f51..ae858cc 100644 --- a/__IMAP_STATUS.h +++ b/__IMAP_STATUS.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_STORE.h b/__IMAP_STORE.h index 0e997d7..52195ec 100644 --- a/__IMAP_STORE.h +++ b/__IMAP_STORE.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_SUBSCRIBE.h b/__IMAP_SUBSCRIBE.h index de3d551..e725342 100644 --- a/__IMAP_SUBSCRIBE.h +++ b/__IMAP_SUBSCRIBE.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_UID.h b/__IMAP_UID.h index e09d892..5d79e75 100644 --- a/__IMAP_UID.h +++ b/__IMAP_UID.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__IMAP_UNSUBSCRIBE.h b/__IMAP_UNSUBSCRIBE.h index 4984ce5..897213a 100644 --- a/__IMAP_UNSUBSCRIBE.h +++ b/__IMAP_UNSUBSCRIBE.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, IMAPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_DELE.h b/__POP3_DELE.h index ce2c8a3..8681ac0 100644 --- a/__POP3_DELE.h +++ b/__POP3_DELE.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_LAST.h b/__POP3_LAST.h index 5b915de..46a6603 100644 --- a/__POP3_LAST.h +++ b/__POP3_LAST.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_LIST.h b/__POP3_LIST.h index ce44506..03f821d 100644 --- a/__POP3_LIST.h +++ b/__POP3_LIST.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_NOOP.h b/__POP3_NOOP.h index 7c248a6..c4f21f9 100644 --- a/__POP3_NOOP.h +++ b/__POP3_NOOP.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_PASS.h b/__POP3_PASS.h index 3746337..70cdb66 100644 --- a/__POP3_PASS.h +++ b/__POP3_PASS.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_QUIT.h b/__POP3_QUIT.h index 991ec03..c94f6a4 100644 --- a/__POP3_QUIT.h +++ b/__POP3_QUIT.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_RETR.h b/__POP3_RETR.h index 6d1d30f..a2ea9a0 100644 --- a/__POP3_RETR.h +++ b/__POP3_RETR.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_RPOP.h b/__POP3_RPOP.h index 3b5252a..e168cc0 100644 --- a/__POP3_RPOP.h +++ b/__POP3_RPOP.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_RSET.h b/__POP3_RSET.h index 6fc4f89..1ffc6f0 100644 --- a/__POP3_RSET.h +++ b/__POP3_RSET.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_STAT.h b/__POP3_STAT.h index 5b4bfc7..681a6d7 100644 --- a/__POP3_STAT.h +++ b/__POP3_STAT.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_TOP.h b/__POP3_TOP.h index b046c8a..8c9f6f6 100644 --- a/__POP3_TOP.h +++ b/__POP3_TOP.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__POP3_USER.h b/__POP3_USER.h index e69a9f9..88ec34b 100644 --- a/__POP3_USER.h +++ b/__POP3_USER.h @@ -10,6 +10,7 @@ namespace mail { int processCommand(coreutils::PString request, POP3Session &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__SMTP_DATA.cpp b/__SMTP_DATA.cpp index d956fa0..056e0af 100644 --- a/__SMTP_DATA.cpp +++ b/__SMTP_DATA.cpp @@ -59,6 +59,7 @@ namespace mail { } break; } + return 1; } std::string __SMTP_DATA::generateMailFileName() { diff --git a/__SMTP_EHLO.cpp b/__SMTP_EHLO.cpp index 2a7b538..9a9660c 100644 --- a/__SMTP_EHLO.cpp +++ b/__SMTP_EHLO.cpp @@ -14,6 +14,7 @@ namespace mail { data << "250-AUTH LOGIN" << CRLF; data << "250 HELP" << CRLF; session.state = READY; + return 1; } } diff --git a/__SMTP_EXPN.cpp b/__SMTP_EXPN.cpp index 3fa8a24..1ea3425 100644 --- a/__SMTP_EXPN.cpp +++ b/__SMTP_EXPN.cpp @@ -6,6 +6,7 @@ namespace mail { int __SMTP_EXPN::processCommand(coreutils::PString request, SMTPSession &session, SMTPServer &server, std::stringstream &data) { data << "252 You must know recipient." << CRLF; session.state = READY; + return 1; } } diff --git a/__SMTP_HELO.cpp b/__SMTP_HELO.cpp index dfb1b49..bdef4dd 100644 --- a/__SMTP_HELO.cpp +++ b/__SMTP_HELO.cpp @@ -9,6 +9,7 @@ namespace mail { data << "250 " << server.hostName << CRLF; session.state = READY; + return 1; } } diff --git a/__SMTP_HELP.cpp b/__SMTP_HELP.cpp index 9236d95..d9d4867 100644 --- a/__SMTP_HELP.cpp +++ b/__SMTP_HELP.cpp @@ -3,10 +3,10 @@ namespace mail { - int __SMTP_HELP::processCommand(coreutils::PString request, SMTPSession &session, SMTPServer &server, std::stringstream &data) { - + int __SMTP_HELP::processCommand(coreutils::PString request, SMTPSession &session, SMTPServer &server, std::stringstream &data) { data << "250 Sure you need help." << CRLF; session.state = READY; + return 1; } } diff --git a/__SMTP_NOOP.cpp b/__SMTP_NOOP.cpp index 378c0ca..be2f9d7 100644 --- a/__SMTP_NOOP.cpp +++ b/__SMTP_NOOP.cpp @@ -11,6 +11,7 @@ namespace mail { int processCommand(coreutils::PString request, SMTPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__SMTP_NOOP.h b/__SMTP_NOOP.h index 378c0ca..be2f9d7 100644 --- a/__SMTP_NOOP.h +++ b/__SMTP_NOOP.h @@ -11,6 +11,7 @@ namespace mail { int processCommand(coreutils::PString request, SMTPSession &session, std::stringstream &data) { data << "250 OK" << CRLF; + return 1; } }; diff --git a/__SMTP_QUIT.cpp b/__SMTP_QUIT.cpp index fdeb81b..11faa94 100644 --- a/__SMTP_QUIT.cpp +++ b/__SMTP_QUIT.cpp @@ -6,6 +6,7 @@ namespace mail { int __SMTP_QUIT::processCommand(coreutils::PString request, SMTPSession &session, SMTPServer &server, std::stringstream &data) { data << "221 " << server.hostName << CRLF; session.shutdown("quit request"); + return 1; } } diff --git a/main.cpp b/main.cpp index d2efa61..cdefe1c 100644 --- a/main.cpp +++ b/main.cpp @@ -29,7 +29,7 @@ int main(int argc, char **argv) { mail::IMAPServer imapServer(ePoll, hostName, mailFileSystem, core::IPAddress(ipAddress, 143)); core::ConsoleServer consoleServer(ePoll, core::IPAddress(ipAddress, 1027)); consoleServer.commands.add(consoleServer.commands, "help"); - ePoll.start(1, 1000); + ePoll.start(4, 1000); while(true) sleep(300);