51 G_EXCEPTION( SendError ,
tx(
"network send error") )
59 bool protocolSend( std::string_view , std::size_t )
override ;
60 void onDelete(
const std::string & )
override ;
61 bool onReceive(
const char * , std::size_t , std::size_t , std::size_t ,
char )
override ;
62 void onSecure(
const std::string & ,
const std::string & ,
const std::string & )
override ;
63 void onSendComplete()
override ;
64 bool securityEnabled()
const override ;
65 void securityStart()
override ;
75 void processLine(
const std::string & line ) ;
78 std::unique_ptr<ServerProtocol::Text> m_ptext ;
88 G_EXCEPTION( Overflow ,
tx(
"too many interface addresses") )
91 bool allow_remote {
false} ;
92 unsigned int port {110} ;
97 std::string sasl_server_config ;
99 Config & set_allow_remote(
bool =
true ) noexcept ;
100 Config & set_port(
unsigned int ) noexcept ;
105 Config & set_sasl_server_config(
const std::string & ) ;
114 void report(
const std::string & group = {} )
const ;
127 std::unique_ptr<ServerProtocol::Text> newProtocolText(
const GNet::Address & )
const ;
135inline GPop::Server::Config & GPop::Server::Config::set_allow_remote(
bool b )
noexcept { allow_remote = b ;
return *this ; }
136inline GPop::Server::Config & GPop::Server::Config::set_port(
unsigned int p )
noexcept { port = p ;
return *this ; }
140inline GPop::Server::Config & GPop::Server::Config::set_protocol_config(
const ServerProtocol::Config & c ) { protocol_config = c ;
return *this ; }
141inline GPop::Server::Config & GPop::Server::Config::set_sasl_server_config(
const std::string & s ) { sasl_server_config = s ;
return *this ; }
An interface used by GAuth::SaslServer to obtain authentication secrets.
The GNet::Address class encapsulates a TCP/UDP transport address.
The EventStateUnbound class is used as a device to force factory methods to plumb-in an ExceptionSour...
A lightweight object containing an ExceptionHandler pointer, optional ExceptionSource pointer and opt...
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::EventStateUnbound, 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() override
Destructor.
Server(GNet::EventState, Store &store, const GAuth::SaslServerSecrets &, const Config &)
Constructor. The 'secrets' reference is kept.
std::vector< std::string > StringArray
A std::vector of std::strings.
constexpr const char * tx(const char *p) noexcept
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.