oasys::SMTP Class Reference

#include <SMTP.h>

Inheritance diagram for oasys::SMTP:

oasys::Logger

List of all members.


Detailed Description

Basic class that implements the SMTP protocol.

Definition at line 34 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

BufferedInputin_
BufferedOutputout_
Config config_

Static Private Attributes

static const char * nl_ = "\r\n"

Classes

struct  Config

Constructor & Destructor Documentation

oasys::SMTP::SMTP ( oasys::BufferedInput in,
oasys::BufferedOutput out,
const Config config,
const char *  logpath 
)

Definition at line 27 of file SMTP.cc.

References ASSERT, in_, oasys::Logger::logpathf(), and out_.


Member Function Documentation

int oasys::SMTP::client_session ( SMTPSender sender,
bool  first_session 
)

Definition at line 45 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 ( oasys::SMTPHandler handler  ) 

Definition at line 125 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 158 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 165 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 300 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 343 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 352 of file SMTP.cc.

Referenced by send_response().


Member Data Documentation

SMTP::Config oasys::SMTP::DEFAULT_CONFIG [static]

Definition at line 57 of file SMTP.h.

const char * oasys::SMTP::nl_ = "\r\n" [static, private]

Definition at line 68 of file SMTP.h.

Referenced by process_cmd(), and process_response().

BufferedInput* oasys::SMTP::in_ [private]

Definition at line 70 of file SMTP.h.

Referenced by process_cmd(), process_response(), and SMTP().

BufferedOutput* oasys::SMTP::out_ [private]

Definition at line 71 of file SMTP.h.

Referenced by client_session(), send_response(), and SMTP().

Config oasys::SMTP::config_ [private]

Definition at line 72 of file SMTP.h.

Referenced by process_cmd(), process_response(), and send_response().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:36:25 2007 for DTN Reference Implementation by  doxygen 1.5.3