1 #ifndef ____SMTP_AUTH_h__ 2 #define ____SMTP_AUTH_h__ 12 int processCommand(coreutils::PString request,
SMTPSession &session,
SMTPService &service, std::stringstream &data) {
17 if(request[1].str() ==
"LOGIN") {
19 data <<
"334 VXNlcm5hbWU6" <<
CRLF;
23 session.server.commands.grabInput(*
this);
26 data <<
"530 AUTH method not supported." <<
CRLF;
36 data <<
"334 UGFzc3dvcmQ6" <<
CRLF;
48 coreutils::Base64 base64;
49 coreutils::Log(coreutils::LOG_INFO) <<
"Logging in with user '" << \
51 "' using password '" << \
52 base64.decode(session.
password) <<
"'.";
54 if(authLogin(base64.decode(session.
userName), base64.decode(session.
password))) {
55 data <<
"235 Authentication successful" <<
CRLF;
58 session.server.commands.clearGrab();
62 data <<
"530 Login was unsuccessful." <<
CRLF;
69 bool authLogin(std::string userName, std::string password) {
Definition: SMTPSession.h:12
AuthState authState
Definition: SMTPSession.h:26
Definition: __SMTP_AUTH.h:10
bool relay
Definition: SMTPSession.h:28
Definition: __IMAP_APPEND.h:7
std::string password
Definition: SMTPSession.h:23
std::string userName
Definition: SMTPSession.h:22
Definition: SMTPCommand.h:9
#define CRLF
Definition: SMTPSession.h:7
Definition: SMTPSession.h:15
Definition: SMTPService.h:21
Definition: SMTPSession.h:12
Definition: SMTPSession.h:12
Definition: SMTPSession.h:12