GSmtp::ServerProtocol Class Reference

Implements the SMTP server-side protocol. More...

#include <gserverprotocol.h>

Inheritance diagram for GSmtp::ServerProtocol:

GNet::AbstractTimer

List of all members.

Public Member Functions

 ServerProtocol (Sender &sender, Verifier &verifier, ProtocolMessage &pmessage, const Secrets &secrets, Text &text, GNet::Address peer_address, Config config)
 Constructor.
void init ()
 Starts the protocol. Use only once after construction.
virtual ~ServerProtocol ()
 Destructor.
void apply (const std::string &line)
 Called on receipt of a string from the client.
void secure ()
 To be called when the transport protocol goes into secure mode.

Protected Member Functions

virtual void onTimeout ()
 Final override from GNet::AbstractTimer.
virtual void onTimeoutException (std::exception &)
 Final override from GNet::AbstractTimer.

Classes

struct  Config
 A structure containing configuration parameters for ServerProtocol. More...
class  Sender
 An interface used by ServerProtocol to send protocol replies. More...
class  Text
 An interface used by ServerProtocol to provide response text strings. More...


Detailed Description

Implements the SMTP server-side protocol.

Uses the ProtocolMessage class as its down-stream interface, used for assembling and processing the incoming email messages.

Uses the ServerProtocol::Sender as its "sideways" interface to talk back to the email-sending client.

See also:
GSmtp::ProtocolMessage, RFC2821

Definition at line 57 of file gserverprotocol.h.


Constructor & Destructor Documentation

GSmtp::ServerProtocol::ServerProtocol ( Sender sender,
Verifier verifier,
ProtocolMessage pmessage,
const Secrets secrets,
Text text,
GNet::Address  peer_address,
Config  config 
)

Constructor.

The Verifier interface is used to verify recipient addresses. See GSmtp::Verifier.

The ProtocolMessage interface is used to assemble and process an incoming message.

The Sender interface is used to send protocol replies back to the client.

The Text interface is used to get informational text for returning to the client.

All references are kept.

Definition at line 34 of file gserverprotocol.cpp.

References GSmtp::SaslServer::active(), G::StateMachine< T, State, Event, Arg >::addTransition(), G::Signal3< P1, P2, P3 >::connect(), GSmtp::Verifier::doneSignal(), GSmtp::ProtocolMessage::doneSignal(), GSsl::Library::enabled(), GSsl::Library::instance(), and G::slot().

GSmtp::ServerProtocol::~ServerProtocol (  )  [virtual]


Member Function Documentation

void GSmtp::ServerProtocol::init (  ) 

Starts the protocol. Use only once after construction.

Definition at line 104 of file gserverprotocol.cpp.

References GSmtp::ServerProtocol::Text::greeting().

Referenced by GSmtp::ServerPeer::ServerPeer().

void GSmtp::ServerProtocol::apply ( const std::string &  line  ) 

Called on receipt of a string from the client.

The string is expected to be CR-LF terminated. Throws ProtocolDone at the end of the protocol.

Definition at line 138 of file gserverprotocol.cpp.

References G::StateMachine< T, State, Event, Arg >::apply(), G_LOG, G::Str::printable(), and G::StateMachine< T, State, Event, Arg >::state().

Referenced by GSmtp::ServerPeer::onReceive().

void GSmtp::ServerProtocol::secure (  ) 

To be called when the transport protocol goes into secure mode.

Definition at line 115 of file gserverprotocol.cpp.

References G::StateMachine< T, State, Event, Arg >::apply().

Referenced by GSmtp::ServerPeer::onSecure().

void GSmtp::ServerProtocol::onTimeout (  )  [protected, virtual]

Final override from GNet::AbstractTimer.

Implements GNet::AbstractTimer.

Definition at line 202 of file gserverprotocol.cpp.

References G::StateMachine< T, State, Event, Arg >::apply(), and G_WARNING.

void GSmtp::ServerProtocol::onTimeoutException ( std::exception &  e  )  [protected, virtual]

Final override from GNet::AbstractTimer.

Implements GNet::AbstractTimer.

Definition at line 210 of file gserverprotocol.cpp.

References G_DEBUG.


The documentation for this class was generated from the following files:

Generated on Fri Apr 18 15:56:14 2008 for E-MailRelay by  doxygen 1.5.5