/home/bradarant/barant/BMAMail/__SMTP_RCPT.h
Go to the documentation of this file.
#ifndef ____SMTP_RCPT_h__
# define ____SMTP_RCPT_h__
# include "Command.h"
# include "MailFileSystem.h"
# include "SMTPService.h"
namespace mail {
class __SMTP_RCPT : public SMTPCommand {
int processCommand(coreutils::PString request, SMTPSession &session, std::stringstream &data) {
if((session.state == MAIL) || (session.state == RCPT)) {
std::string recipient = request[1].str();
if(session.service.mailFileSystem.isMailbox(recipient)) {
session.recipientList.push_back(recipient);
data << "250 OK" << CRLF;
session.state = RCPT;
} else if(session.relay) {
session.recipientList.push_back(recipient);
data << "250 OK" << CRLF;
session.state = RCPT;
} else
data << "553 Mailbox does not exist" << CRLF;
}
else
data << "503 Please use MAIL first" << CRLF;
return 0;
}
};
}
#endif
SMTPService.h
mail::SMTPSession::state
State state
Definition: SMTPSession.h:25
mail::MAIL
Definition: SMTPSession.h:11
mail::SMTPSession::relay
bool relay
Definition: SMTPSession.h:28
mail::SMTPSession::recipientList
std::vector< std::string > recipientList
Definition: SMTPSession.h:30
mail
Definition: __IMAP_APPEND.h:7
MailFileSystem.h
mail::SMTPCommand
Definition: SMTPCommand.h:9
CRLF
#define CRLF
Definition: SMTPSession.h:7
mail::SMTPSession
Definition: SMTPSession.h:15
mail::__SMTP_RCPT
Definition: __SMTP_RCPT.h:10
mail::RCPT
Definition: SMTPSession.h:11