based on reworked servercore.
This commit is contained in:
1 parent
50eb707f10
commit
db3e82a18e
1698 files changed
+41157
-797
No files matched your search
+29
-6
@@ -1,14 +1,37 @@
|
||||
#ifndef __SMTPSession_h__
|
||||
#define __SMTPSession_h__
|
||||
# define __SMTPSession_h__
|
||||
|
||||
#include "includes"
|
||||
# include "TCPSession.h"
|
||||
# include "TCPServer.h"
|
||||
|
||||
# define CRLF "\r\n"
|
||||
|
||||
namespace mail {
|
||||
|
||||
enum State {CONNECT, READY, MAIL, RCPT, DATA};
|
||||
enum AuthState {USER_UNKNOWN, USER_QUERY, USER_SECRET_QUERY, USER_KNOWN};
|
||||
enum Mode {WAIT_FOR_DATA, RECEIVE_DATA};
|
||||
|
||||
class SMTPSession : public core::TCPSession {
|
||||
|
||||
public:
|
||||
SMTPSession(core::EPoll &ePoll, core::TCPServer &server)
|
||||
: TCPSession(ePoll, server, "SMTP Client Session") {}
|
||||
|
||||
class SMTPSession : public core::Session {
|
||||
|
||||
public:
|
||||
std::string state;
|
||||
void onConnected(std::stringstream &out) {
|
||||
out << "220 localhost BMAMail" << CRLF;
|
||||
}
|
||||
|
||||
std::string clientDomainName;
|
||||
std::string userName;
|
||||
std::string password;
|
||||
std::stringstream mailData;
|
||||
State state = CONNECT;
|
||||
AuthState authState = USER_UNKNOWN;
|
||||
Mode mode = WAIT_FOR_DATA;
|
||||
bool relay = false;
|
||||
std::string sender;
|
||||
std::vector<std::string> recipientList;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user