#include <SMTP.h>
Inheritance diagram for oasys::SMTP:
Definition at line 55 of file SMTP.h.
Public Member Functions | |
SMTP (BufferedInput *in, BufferedOutput *out, const Config &config, const char *logpath) | |
int | client_session (SMTPSender *sender, bool first_session) |
int | server_session (SMTPHandler *handler) |
Static Public Attributes | |
static Config | DEFAULT_CONFIG |
Private Member Functions | |
int | send_signon () |
Send sign on message. | |
int | process_cmd (SMTPHandler *handler) |
Process a command. | |
int | process_response (int expected_code) |
Process a response. | |
int | send_response (int code) |
Send back a response. | |
const char * | response_code (int code) const |
Response code may include a s for the domain name. | |
Private Attributes | |
BufferedInput * | in_ |
BufferedOutput * | out_ |
Config | config_ |
Static Private Attributes | |
static const char * | nl_ |
Classes | |
struct | Config |
oasys::SMTP::SMTP | ( | BufferedInput * | in, | |
BufferedOutput * | out, | |||
const Config & | config, | |||
const char * | logpath | |||
) |
int oasys::SMTP::client_session | ( | SMTPSender * | sender, | |
bool | first_session | |||
) |
Definition at line 29 of file SMTP.cc.
References end, oasys::BufferedOutput::flush(), oasys::SMTPSender::get_DATA(), oasys::SMTPSender::get_HELO_domain(), oasys::SMTPSender::get_MAIL_from(), oasys::SMTPSender::get_RCPT_list(), oasys::SMTPSender::get_RECEIVED(), message(), out_, oasys::BufferedOutput::printf(), process_response(), and oasys::BufferedOutput::write().
Referenced by oasys::SMTPFdClient::send_message(), and oasys::SMTPClient::send_message().
int oasys::SMTP::server_session | ( | SMTPHandler * | handler | ) |
Definition at line 109 of file SMTP.cc.
References log_info, log_warn, process_cmd(), send_response(), and send_signon().
Referenced by oasys::SMTPHandlerThread::run().
int oasys::SMTP::send_signon | ( | ) | [private] |
Send sign on message.
Definition at line 142 of file SMTP.cc.
References send_response().
Referenced by server_session().
int oasys::SMTP::process_cmd | ( | SMTPHandler * | handler | ) | [private] |
Process a command.
Definition at line 149 of file SMTP.cc.
References ASSERT, config_, in_, log_debug, log_info, log_warn, nl_, oasys::BufferedInput::read_line(), send_response(), SKIP_WS, oasys::SMTPHandler::smtp_DATA_begin(), oasys::SMTPHandler::smtp_DATA_end(), oasys::SMTPHandler::smtp_DATA_line(), oasys::SMTPHandler::smtp_HELO(), oasys::SMTPHandler::smtp_MAIL(), oasys::SMTPHandler::smtp_QUIT(), oasys::SMTPHandler::smtp_RCPT(), oasys::SMTPHandler::smtp_RSET(), and oasys::SMTP::Config::timeout_.
Referenced by server_session().
int oasys::SMTP::process_response | ( | int | expected_code | ) | [private] |
Process a response.
Definition at line 284 of file SMTP.cc.
References config_, end, in_, log_debug, log_info, log_warn, nl_, oasys::BufferedInput::read_line(), and oasys::SMTP::Config::timeout_.
Referenced by client_session().
int oasys::SMTP::send_response | ( | int | code | ) | [private] |
Send back a response.
Definition at line 327 of file SMTP.cc.
References config_, oasys::SMTP::Config::domain_, oasys::BufferedOutput::format_buf(), out_, oasys::BufferedOutput::printf(), and response_code().
Referenced by process_cmd(), send_signon(), and server_session().
const char * oasys::SMTP::response_code | ( | int | code | ) | const [private] |
Response code may include a s for the domain name.
Definition at line 336 of file SMTP.cc.
Referenced by send_response().
SMTP::Config oasys::SMTP::DEFAULT_CONFIG [static] |
const char * oasys::SMTP::nl_ [static, private] |
BufferedInput* oasys::SMTP::in_ [private] |
BufferedOutput* oasys::SMTP::out_ [private] |
Config oasys::SMTP::config_ [private] |
Definition at line 93 of file SMTP.h.
Referenced by process_cmd(), process_response(), and send_response().