21 #ifndef G_SMTP_ADMIN_H
22 #define G_SMTP_ADMIN_H
54 bool with_terminate ) ;
60 void notify(
const std::string & s0 ,
const std::string & s1 ,
const std::string & s2 ) ;
67 virtual bool onReceive(
const char * ,
size_t ,
size_t )
override ;
70 virtual void onDelete(
const std::string & )
override ;
73 virtual void onSecure(
const std::string & )
override ;
79 void clientDone( std::string ) ;
80 static bool is(
const std::string & ,
const std::string & ) ;
81 static std::pair<bool,std::string> find(
const std::string & line ,
const G::StringMap & map ) ;
82 static std::string argument(
const std::string & ) ;
89 void sendLine( std::string ,
bool =
true ) ;
93 std::string eol()
const ;
95 void send_(
const std::string & ) ;
99 std::string m_prompt ;
101 std::string m_remote_address ;
106 bool m_with_terminate ;
117 const GNet::MultiServer::AddressList & listening_addresses ,
bool allow_remote ,
118 const std::string & remote_address ,
unsigned int connection_timeout ,
120 bool with_terminate ) ;
146 void notify(
const std::string & s0 ,
const std::string & s1 ,
const std::string & s2 ) ;
162 typedef std::list<AdminServerPeer*> PeerList ;
167 bool m_allow_remote ;
168 std::string m_remote_address ;
169 unsigned int m_connection_timeout ;
172 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 onSendComplete() override
Override from GNet::BufferedServerPeer.
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.
AdminServer(GNet::ExceptionHandler &, MessageStore &store, const GSmtp::Client::Config &client_config, const GAuth::Secrets &client_secrets, const GNet::MultiServer::AddressList &listening_addresses, bool allow_remote, const std::string &remote_address, unsigned int connection_timeout, const G::StringMap &info_commands, const G::StringMap &config_commands, bool with_terminate)
Constructor.
void report() const
Generates helpful diagnostics.
virtual void onDelete(const std::string &) override
Override from GNet::ServerPeer.
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
AdminServerPeer(GNet::Server::PeerInfo, AdminServer &, const std::string &remote, const G::StringMap &info_commands, const G::StringMap &config_commands, bool with_terminate)
Constructor.
A class which allows SMTP messages to be stored and retrieved.
A simple interface for a store of secrets used in authentication.
const GAuth::Secrets & secrets() const
Returns a reference to the secrets object, as passed in to the constructor.
A structure used in GNet::MultiServer::newPeer().
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 bool onReceive(const char *, size_t, size_t) override
Override from GNet::BufferedServerPeer.
std::map< std::string, std::string > StringMap
A std::map of std::strings.
A smart pointer class for GNet::HeapClient that keeps track of when the contained instance deletes it...
virtual void onSecure(const std::string &) override
Override from GNet::SocketProtocolSink.
virtual ~AdminServer()
Destructor.
virtual GNet::ServerPeer * newPeer(GNet::Server::PeerInfo, GNet::MultiServer::ServerInfo) g__final override
Override from GNet::MultiServer.
A server that listens on more than one interface using a facade pattern to multiple GNet::Server inst...
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.
An iterator class for GSmtp::MessageStore.