21 #ifndef G_SMTP_SERVER_H
22 #define G_SMTP_SERVER_H
58 const GAuth::Secrets & ,
const std::string & verifier_address ,
unsigned int verifier_timeout ,
66 virtual void onDelete(
const std::string & reason ) ;
69 virtual bool onReceive(
const std::string & line ) ;
72 virtual void onSecure(
const std::string & ) ;
78 virtual void protocolSend(
const std::string & line ,
bool ) ;
79 static const std::string & crlf() ;
83 std::auto_ptr<Verifier> m_verifier ;
84 std::auto_ptr<ProtocolMessage> m_pmessage ;
85 std::auto_ptr<ServerProtocol::Text> m_ptext ;
96 G_EXCEPTION( Overflow ,
"too many interface addresses" ) ;
116 Config(
bool ,
unsigned int ,
const AddressList & ,
const std::string & ,
bool ,
117 const std::string & ,
unsigned int ,
const std::string & ,
unsigned int ,
bool ) ;
121 Config server_config , std::string smtp_server_address ,
unsigned int smtp_connection_timeout ,
150 ProtocolMessage * newProtocolMessageStore( std::auto_ptr<Processor> ) ;
151 ProtocolMessage * newProtocolMessageScanner( std::auto_ptr<ProtocolMessage> ) ;
152 ProtocolMessage * newProtocolMessageForward( std::auto_ptr<ProtocolMessage> ) ;
157 std::string m_processor_address ;
158 unsigned int m_processor_timeout ;
160 std::string m_ident ;
161 bool m_allow_remote ;
163 std::string m_smtp_server ;
164 unsigned int m_smtp_connection_timeout ;
166 std::string m_verifier_address ;
167 unsigned int m_verifier_timeout ;
169 std::auto_ptr<ServerProtocol::Text> m_protocol_text ;
171 std::auto_ptr<GNet::ConnectionLookup> m_connection_lookup ;
virtual ~Server()
Destructor.
An interface used by ServerProtocol to send protocol replies.
GNet::ServerPeer * newPeer(GNet::Server::PeerInfo)
From MultiServer.
An abstract base class for the GNet::Server's connection to a remote client.
Represents a connection from an SMTP client.
SMTP and message-store classes.
An interface used by ServerProtocol to provide response text strings.
std::list< GNet::Address > AddressList
The Address class encapsulates an IP transport address.
Server(MessageStore &store, const GAuth::Secrets &client_secrets, const GAuth::Secrets &server_secrets, Config server_config, std::string smtp_server_address, unsigned int smtp_connection_timeout, GSmtp::Client::Config client_config)
Constructor.
Implements the SMTP server-side protocol.
void report() const
Generates helpful diagnostics after construction.
Server * server()
Returns a pointer to the associated server object.
G::Signal2< std::string, std::string > & eventSignal()
Returns a signal that indicates that something has happened.
unsigned int verifier_timeout
A structure containing GSmtp::Server configuration parameters.
virtual bool onReceive(const std::string &line)
Final override from GNet::BufferedServerPeer.
A class which allows SMTP messages (envelope+content) to be stored and retrieved. ...
A simple interface to a store of secrets as used in authentication.
virtual void onDelete(const std::string &reason)
Final override from GNet::ServerPeer.
virtual void onSecure(const std::string &)
Final override from GNet::SocketProtocolSink.
unsigned int processor_timeout
A structure containing GSmtp::Client configuration parameters.
std::string processor_address
A structure containing configuration parameters for ServerProtocol.
#define G_EXCEPTION(class_name, description)
define as a function rather than a type if optimising for size
virtual void onSendComplete()
Final override from GNet::BufferedServerPeer.
An interface used by the ServerProtocol class to assemble and process an incoming message...
Config(bool, unsigned int, const AddressList &, const std::string &, bool, const std::string &, unsigned int, const std::string &, unsigned int, bool)
ServerPeer(GNet::Server::PeerInfo, Server &server, std::auto_ptr< ProtocolMessage > pmessage, const GAuth::Secrets &, const std::string &verifier_address, unsigned int verifier_timeout, std::auto_ptr< ServerProtocol::Text > ptext, ServerProtocol::Config)
Constructor.
bool use_connection_lookup
std::string verifier_address
A server that listens on more than one interface using a facade pattern to multiple Server instances...
A ServerPeer that does line-buffering on input.
A structure used in GNet::Server::newPeer().