21 #ifndef G_SMTP_ADMIN_H
22 #define G_SMTP_ADMIN_H
43 class AdminServerPeer ;
55 const std::string & remote ,
const G::StringMap & extra_commands ,
bool with_terminate ) ;
61 void notify(
const std::string & s0 ,
const std::string & s1 ,
const std::string & s2 ) ;
68 virtual bool onReceive(
const std::string & ) ;
71 virtual void onDelete(
const std::string & ) ;
74 virtual void onSecure(
const std::string & ) ;
80 void clientDone( std::string ,
bool ) ;
81 static bool is(
const std::string & ,
const std::string & ) ;
82 static std::pair<bool,std::string> find(
const std::string & line ,
const G::StringMap & map ) ;
90 void sendLine( std::string ) ;
94 static const std::string & crlf() ;
102 std::string m_remote_address ;
106 bool m_with_terminate ;
117 bool allow_remote ,
const GNet::Address & local_address ,
const std::string & remote_address ,
118 unsigned int connection_timeout ,
const G::StringMap & extra_commands ,
bool with_terminate ) ;
145 void notify(
const std::string & s0 ,
const std::string & s1 ,
const std::string & s2 ) ;
161 typedef std::list<AdminServerPeer*> PeerList ;
167 bool m_allow_remote ;
168 std::string m_remote_address ;
169 unsigned int m_connection_timeout ;
171 bool m_with_terminate ;
An abstract base class for the GNet::Server's connection to a remote client.
A server class which implements the emailrelay administration interface.
SMTP and message-store classes.
virtual void onDelete(const std::string &)
Final override from GNet::ServerPeer.
void notify(const std::string &s0, const std::string &s1, const std::string &s2)
Called when something happens which the admin user might be interested in.
void unregister(AdminServerPeer *)
Called from the AdminServerPeer destructor.
The Address class encapsulates an IP transport address.
void report() const
Generates helpful diagnostics.
AdminServer(MessageStore &store, const GSmtp::Client::Config &client_config, const GAuth::Secrets &client_secrets, const GNet::MultiServer::AddressList &listening_addresses, bool allow_remote, const GNet::Address &local_address, const std::string &remote_address, unsigned int connection_timeout, const G::StringMap &extra_commands, bool with_terminate)
Constructor.
virtual bool onReceive(const std::string &)
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.
const GAuth::Secrets & secrets() const
Returns a reference to the secrets object, as passed in to the constructor.
MessageStore & store()
Returns a reference to the message store, as passed in to the constructor.
virtual ~AdminServerPeer()
Destructor.
void notify(const std::string &s0, const std::string &s1, const std::string &s2)
Called when something happens.
A structure containing GSmtp::Client configuration parameters.
A derivation of ServerPeer for the administration interface.
virtual GNet::ServerPeer * newPeer(GNet::Server::PeerInfo)
Final override from GNet::MultiServer.
virtual void onSendComplete()
Final override from GNet::BufferedServerPeer.
std::map< std::string, std::string > StringMap
A std::map of std::strings.
A class which does line buffering.
AdminServerPeer(GNet::Server::PeerInfo, AdminServer &, const GNet::Address &local, const std::string &remote, const G::StringMap &extra_commands, bool with_terminate)
Constructor.
std::list< Address > AddressList
virtual ~AdminServer()
Destructor.
A server that listens on more than one interface using a facade pattern to multiple Server instances...
GSmtp::Client::Config clientConfig() const
Returns the client configuration.
A ServerPeer that does line-buffering on input.
A structure used in GNet::Server::newPeer().
unsigned int connectionTimeout() const
Returns the connection timeout, as passed in to the constructor.
virtual void onSecure(const std::string &)
Final override from GNet::SocketProtocolSink.
An iterator class for GSmtp::MessageStore.