based on reworked servercore.
This commit is contained in:
1 parent
50eb707f10
commit
db3e82a18e
1698 files changed
+41157
-797
No files matched your search
@@ -0,0 +1,32 @@
|
||||
#include "__SMTP_MAIL.h"
|
||||
#include "SMTPServer.h"
|
||||
|
||||
namespace mail {
|
||||
|
||||
int __SMTP_MAIL::processCommand(coreutils::PString request, SMTPSession &session, SMTPServer &server, std::stringstream &data) {
|
||||
|
||||
if(request.ifNext("MAIL FROM:")) {
|
||||
request.skipWhitespace();
|
||||
if(request.ifNext("<")) {
|
||||
session.sender = request.getTokenExclude(">");
|
||||
if(session.authState = USER_KNOWN) {
|
||||
data << "250 OK" << CRLF;
|
||||
session.recipientList.clear();
|
||||
session.state = MAIL;
|
||||
}
|
||||
} else
|
||||
data << "550 Usage: MAIL FROM:<email-address>" << CRLF;
|
||||
} else
|
||||
data << "550 Usage: MAIL FROM:<email-address>" << CRLF;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string domainOnly(std::string email) {
|
||||
coreutils::PString split(email);
|
||||
split.split("@");
|
||||
return split[1].str();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user