Bunch of changes.
This commit is contained in:
1 parent
0a4d17e6e6
commit
641368ea85
15 files changed
+441
-1327
No files matched your search
+8
-8
@@ -3,11 +3,11 @@
|
||||
#include "SMTPServer.h"
|
||||
|
||||
namespace mail {
|
||||
|
||||
|
||||
int __SMTP_AUTH::processCommand(coreutils::ZString &request, SMTPSession &session, SMTPServer &server) {
|
||||
|
||||
|
||||
switch(session.authState) {
|
||||
|
||||
|
||||
case USER_UNKNOWN:
|
||||
if(request[1].equals("LOGIN")) {
|
||||
session.out << "334 VXNlcm5hbWU6" << CRLF;
|
||||
@@ -19,7 +19,7 @@ namespace mail {
|
||||
session.out << "504 AUTH method not supported." << CRLF;
|
||||
}
|
||||
return 1;
|
||||
|
||||
|
||||
case USER_QUERY:
|
||||
session.userName = request[0];
|
||||
// setTimer(0.0f);
|
||||
@@ -27,7 +27,7 @@ namespace mail {
|
||||
// setTimer(10.0f);
|
||||
session.authState = USER_SECRET_QUERY;
|
||||
return 1;
|
||||
|
||||
|
||||
case USER_SECRET_QUERY:
|
||||
session.password = request[0];
|
||||
// setTimer(0.0f);
|
||||
@@ -45,13 +45,13 @@ namespace mail {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool __SMTP_AUTH::authLogin(coreutils::ZString &userName, coreutils::ZString &password, SMTPServer &server) {
|
||||
coreutils::MString secretPath;
|
||||
secretPath << server.mailFileSystem.getMailBoxPath(userName) << "/.password";
|
||||
coreutils::File secret(secretPath);
|
||||
secret.read();
|
||||
return password == secret.asString();
|
||||
return password == secret.asZString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user