/home/bradarant/barant/BMAMail/SMTPSession.h
Go to the documentation of this file.
#ifndef __SMTPSession_h__
# define __SMTPSession_h__
# 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) {}
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;
};
}
#endif
mail::RECEIVE_DATA
Definition: SMTPSession.h:13
mail::SMTPSession::clientDomainName
std::string clientDomainName
Definition: SMTPSession.h:21
mail::SMTPSession::state
State state
Definition: SMTPSession.h:25
mail::USER_UNKNOWN
Definition: SMTPSession.h:12
mail::MAIL
Definition: SMTPSession.h:11
mail::CONNECT
Definition: SMTPSession.h:11
mail::WAIT_FOR_DATA
Definition: SMTPSession.h:13
mail::READY
Definition: SMTPSession.h:11
mail::SMTPSession::authState
AuthState authState
Definition: SMTPSession.h:26
mail::DATA
Definition: SMTPSession.h:11
mail::SMTPSession::SMTPSession
SMTPSession(core::EPoll &ePoll, core::TCPServer &server)
Definition: SMTPSession.h:18
mail::SMTPSession::relay
bool relay
Definition: SMTPSession.h:28
mail::SMTPSession::recipientList
std::vector< std::string > recipientList
Definition: SMTPSession.h:30
mail::SMTPSession::mode
Mode mode
Definition: SMTPSession.h:27
mail
Definition: __IMAP_APPEND.h:7
mail::SMTPSession::password
std::string password
Definition: SMTPSession.h:23
mail::SMTPSession::userName
std::string userName
Definition: SMTPSession.h:22
mail::AuthState
AuthState
Definition: SMTPSession.h:12
mail::SMTPSession::sender
std::string sender
Definition: SMTPSession.h:29
mail::SMTPSession
Definition: SMTPSession.h:15
mail::SMTPSession::mailData
std::stringstream mailData
Definition: SMTPSession.h:24
mail::USER_QUERY
Definition: SMTPSession.h:12
mail::Mode
Mode
Definition: SMTPSession.h:13
mail::USER_KNOWN
Definition: SMTPSession.h:12
mail::State
State
Definition: SMTPSession.h:11
mail::RCPT
Definition: SMTPSession.h:11
mail::USER_SECRET_QUERY
Definition: SMTPSession.h:12