50 G_EXCEPTION( SendError ,
tx(
"network send error") ) ;
59 void onDelete(
const std::string & )
override ;
60 bool onReceive(
const char * , std::size_t , std::size_t , std::size_t ,
char )
override ;
61 void onSecure(
const std::string & ,
const std::string & ,
const std::string & )
override ;
62 void onSendComplete()
override ;
63 bool securityEnabled()
const override ;
64 void securityStart()
override ;
74 void processLine(
const std::string & line ) ;
77 std::unique_ptr<ServerProtocol::Text> m_ptext ;
87 G_EXCEPTION( Overflow ,
tx(
"too many interface addresses") ) ;
90 bool allow_remote{
false} ;
91 unsigned int port{110} ;
95 std::string sasl_server_config ;
96 std::string sasl_server_challenge_domain ;
98 Config & set_allow_remote(
bool =
true ) ;
99 Config & set_port(
unsigned int ) ;
103 Config & set_sasl_server_config(
const std::string & ) ;
104 Config & set_sasl_server_challenge_domain(
const std::string & ) ;
113 void report(
const std::string & group = {} )
const ;
126 std::unique_ptr<ServerProtocol::Text> newProtocolText(
const GNet::Address & )
const ;
134inline GPop::Server::Config & GPop::Server::Config::set_allow_remote(
bool b ) { allow_remote = b ;
return *this ; }
135inline GPop::Server::Config & GPop::Server::Config::set_port(
unsigned int p ) { port = p ;
return *this ; }
139inline GPop::Server::Config & GPop::Server::Config::set_sasl_server_config(
const std::string & s ) { sasl_server_config = s ;
return *this ; }
140inline GPop::Server::Config & GPop::Server::Config::set_sasl_server_challenge_domain(
const std::string & s ) { sasl_server_challenge_domain = s ;
return *this ; }
An interface used by GAuth::SaslServer to obtain authentication secrets.
The GNet::Address class encapsulates a TCP/UDP transport address.
A potential ExceptionSink that is realised by bind()ing an exception source pointer.
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.
A server that listens on more than one address using a facade pattern to multiple GNet::Server instan...
A move-only structure used in GNet::Server::newPeer() and containing the new socket.
An abstract base class for the GNet::Server's connection to a remote client.
Represents a connection from a POP client.
ServerPeer(GNet::ExceptionSinkUnbound, GNet::ServerPeerInfo &&, Store &, const GAuth::SaslServerSecrets &, const std::string &sasl_server_config, std::unique_ptr< ServerProtocol::Text > ptext, const ServerProtocol::Config &)
Constructor.
An interface used by ServerProtocol to enable TLS.
An interface used by ServerProtocol to send protocol replies.
Implements the POP server-side protocol.
void report(const std::string &group={}) const
Generates helpful diagnostics after construction.
Server(GNet::ExceptionSink, Store &store, const GAuth::SaslServerSecrets &, const Config &)
Constructor. The 'secrets' reference is kept.
~Server() override
Destructor.
A class like c++17's std::string_view.
std::vector< std::string > StringArray
A std::vector of std::strings.
constexpr const char * tx(const char *p)
A briefer alternative to G::gettext_noop().
A structure used in GNet::MultiServer::newPeer().
A configuration structure for GNet::ServerPeer.
A configuration structure for GNet::Server.
A structure containing configuration parameters for ServerProtocol.
A structure containing GPop::Server configuration parameters.