62 lines
1.7 KiB
C++
62 lines
1.7 KiB
C++
#ifndef __POP3Server_h__
|
|
#define __POP3Server_h__
|
|
|
|
#include "TCPServer.h"
|
|
#include "Exception.h"
|
|
#include "__POP3_DELE.h"
|
|
#include "__POP3_LAST.h"
|
|
#include "__POP3_LIST.h"
|
|
#include "__POP3_NOOP.h"
|
|
#include "__POP3_PASS.h"
|
|
#include "__POP3_QUIT.h"
|
|
#include "__POP3_RETR.h"
|
|
#include "__POP3_RPOP.h"
|
|
#include "__POP3_RSET.h"
|
|
#include "__POP3_STAT.h"
|
|
#include "__POP3_TOP.h"
|
|
#include "__POP3_USER.h"
|
|
|
|
namespace mail {
|
|
|
|
class POP3Server : public core::TCPServer {
|
|
|
|
public:
|
|
POP3Server(core::EPoll &epoll, std::string hostName, MailFileSystem &mailFileSystem, core::IPAddress ipAddress)
|
|
: TCPServer(epoll, ipAddress, " ", 10, "POP3 Server"), mailFileSystem(mailFileSystem), hostName(hostName) {
|
|
commands.add(_pop3_dele, "DELE");
|
|
commands.add(_pop3_last, "LAST");
|
|
commands.add(_pop3_list, "LIST");
|
|
commands.add(_pop3_noop, "NOOP");
|
|
commands.add(_pop3_pass, "PASS");
|
|
commands.add(_pop3_quit, "QUIT");
|
|
commands.add(_pop3_retr, "RETR");
|
|
commands.add(_pop3_rpop, "RPOP");
|
|
commands.add(_pop3_rset, "RSET");
|
|
commands.add(_pop3_stat, "STAT");
|
|
commands.add(_pop3_top, "TOP");
|
|
commands.add(_pop3_user, "USER");
|
|
}
|
|
|
|
MailFileSystem &mailFileSystem;
|
|
std::string hostName;
|
|
|
|
private:
|
|
__POP3_DELE _pop3_dele;
|
|
__POP3_LAST _pop3_last;
|
|
__POP3_LIST _pop3_list;
|
|
__POP3_NOOP _pop3_noop;
|
|
__POP3_PASS _pop3_pass;
|
|
__POP3_QUIT _pop3_quit;
|
|
__POP3_RETR _pop3_retr;
|
|
__POP3_RPOP _pop3_rpop;
|
|
__POP3_RSET _pop3_rset;
|
|
__POP3_STAT _pop3_stat;
|
|
__POP3_TOP _pop3_top;
|
|
__POP3_USER _pop3_user;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|