21 #ifndef G_SMTP_SERVER_H
22 #define G_SMTP_SERVER_H
52 typedef std::vector<GNet::Address> AddressList ;
53 G_EXCEPTION( Overflow ,
"too many interface addresses" ) ;
59 AddressList interfaces ;
62 std::string filter_address ;
63 unsigned int filter_timeout ;
64 std::string verifier_address ;
65 unsigned int verifier_timeout ;
66 bool verifier_compatibility ;
69 Config(
bool allow_remote ,
unsigned int port ,
const AddressList & ,
const std::string & ident ,
70 bool anonymous ,
const std::string & filter_address ,
unsigned int filter_timeout ,
71 const std::string & verifier_adress ,
unsigned int verifier_timeout ,
bool verifier_compatibility ,
100 unique_ptr<Filter> newFilter(
ServerPeer & ) ;
101 unique_ptr<ProtocolMessage> newProtocolMessageStore( unique_ptr<Filter> ) ;
102 unique_ptr<ProtocolMessage> newProtocolMessageScanner( unique_ptr<ProtocolMessage> ) ;
103 unique_ptr<ProtocolMessage> newProtocolMessageForward( unique_ptr<ProtocolMessage> ) ;
104 unique_ptr<ServerProtocol::Text> newProtocolText(
bool ,
const GNet::Address & )
const ;
112 std::string m_forward_to ;
124 G_EXCEPTION( SendError ,
"failed to send smtp response" ) ;
128 unique_ptr<ServerProtocol::Text> ptext ) ;
135 virtual void onDelete(
const std::string & reason )
override ;
138 virtual void onData(
const char * ,
size_t )
override ;
141 virtual void onSecure(
const std::string & )
override ;
147 virtual void protocolSend(
const std::string & line ,
bool )
override ;
148 virtual void protocolShutdown()
override ;
152 unique_ptr<Verifier> m_verifier ;
153 unique_ptr<ProtocolMessage> m_pmessage ;
154 unique_ptr<ServerProtocol::Text> m_ptext ;
virtual ~Server()
Destructor.
An interface used by ServerProtocol to send protocol replies.
An abstract base class for the GNet::Server's connection to a remote client.
ServerPeer(GNet::Server::PeerInfo peer_info, Server &server, const GAuth::Secrets &server_secrets, const Server::Config &server_config, unique_ptr< ServerProtocol::Text > ptext)
Constructor.
unique_ptr< ProtocolMessage > newProtocolMessage(ServerPeer &)
Called by GSmtp::ServerPeer to construct a ProtocolMessage.
Handles a connection from a remote SMTP client.
SMTP and message-store classes.
virtual void onSecure(const std::string &) override
Override from GNet::SocketProtocolSink.
The GNet::Address class encapsulates a TCP/UDP transport address.
virtual void onDelete(const std::string &reason) override
Override from GNet::ServerPeer.
Implements the SMTP server-side protocol.
Server(GNet::ExceptionHandler &eh, MessageStore &store, const GAuth::Secrets &client_secrets, const GAuth::Secrets &server_secrets, Config server_config, std::string forward_to, GSmtp::Client::Config client_config)
Constructor.
void report() const
Generates helpful diagnostics after construction.
Server * server()
Returns a pointer to the associated server object.
virtual void onData(const char *, size_t) override
Override from GNet::SocketProtocolSink.
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events...
A structure containing GSmtp::Server configuration parameters.
A class which allows SMTP messages to be stored and retrieved.
A simple interface for a store of secrets used in authentication.
A structure used in GNet::MultiServer::newPeer().
A structure containing GSmtp::Client configuration parameters.
A structure containing configuration parameters for ServerProtocol.
A class that does line buffering, supporting auto-detection of line endings and fixed-size extraction...
G::Slot::Signal2< std::string, std::string > & eventSignal()
Returns a signal that indicates that something has happened.
A server that listens on more than one interface using a facade pattern to multiple GNet::Server inst...
virtual void onSendComplete() override
Override from GNet::ServerPeer.
A structure used in GNet::Server::newPeer().