E-MailRelay
|
An SMTP server class. More...
#include <gsmtpserver.h>
Classes | |
struct | Config |
A structure containing GSmtp::Server configuration parameters. More... | |
Public Types | |
using | AddressList = std::vector< GNet::Address > |
![]() | |
using | AddressList = std::vector< Address > |
Public Member Functions | |
Server (GNet::ExceptionSink es, MessageStore &store, FilterFactory &, const GAuth::SaslClientSecrets &client_secrets, const GAuth::SaslServerSecrets &server_secrets, const Config &server_config, const std::string &forward_to, const GSmtp::Client::Config &client_config) | |
Constructor. More... | |
~Server () override | |
Destructor. More... | |
void | report () const |
Generates helpful diagnostics after construction. More... | |
G::Slot::Signal< const std::string &, const std::string & > & | eventSignal () |
Returns a signal that indicates that something has happened. More... | |
std::unique_ptr< ProtocolMessage > | newProtocolMessage (GNet::ExceptionSink) |
Called by GSmtp::ServerPeer to construct a ProtocolMessage. More... | |
Server (const Server &)=delete | |
Server (Server &&)=delete | |
void | operator= (const Server &)=delete |
void | operator= (Server &&)=delete |
![]() | |
MultiServer (ExceptionSink listener_exception_sink, const G::StringArray &addresses, unsigned int port, const std::string &server_type, ServerPeerConfig server_peer_config, ServerConfig server_config) | |
Constructor. More... | |
~MultiServer () override | |
Destructor. More... | |
bool | hasPeers () const |
Returns true if peers() is not empty. More... | |
std::vector< std::weak_ptr< ServerPeer > > | peers () |
Returns the list of ServerPeer-derived objects. More... | |
std::unique_ptr< ServerPeer > | doNewPeer (ExceptionSinkUnbound, const ServerPeerInfo &, const ServerInfo &) |
Pseudo-private method used by the pimple class. More... | |
MultiServer (const MultiServer &)=delete | |
MultiServer (MultiServer &&)=delete | |
void | operator= (const MultiServer &)=delete |
void | operator= (MultiServer &&)=delete |
Additional Inherited Members | |
![]() | |
static bool | canBind (const AddressList &listening_address_list, bool do_throw) |
Checks that all the specified addresses can be bound. More... | |
![]() | |
virtual std::unique_ptr< ServerPeer > | newPeer (ExceptionSinkUnbound, ServerPeerInfo, ServerInfo)=0 |
A factory method which new()s a ServerPeer-derived object. More... | |
void | serverCleanup () |
Should be called from all derived classes' destructors so that peer objects can use their Server objects safely during their own destruction. More... | |
void | serverReport () const |
Writes to the system log a summary of the underlying server objects and their addresses. More... | |
An SMTP server class.
Definition at line 49 of file gsmtpserver.h.
using GSmtp::Server::AddressList = std::vector<GNet::Address> |
Definition at line 52 of file gsmtpserver.h.
GSmtp::Server::Server | ( | GNet::ExceptionSink | es, |
MessageStore & | store, | ||
FilterFactory & | ff, | ||
const GAuth::SaslClientSecrets & | client_secrets, | ||
const GAuth::SaslServerSecrets & | server_secrets, | ||
const Config & | server_config, | ||
const std::string & | forward_to, | ||
const GSmtp::Client::Config & | client_config | ||
) |
Constructor.
Listens on the given port number using INET_ANY if 'server_config.interfaces' is empty, or on specific interfaces otherwise.
If the forward-to address is given then all messages are forwarded immediately, using the given client configuration.
Definition at line 206 of file gsmtpserver.cpp.
|
override |
Destructor.
Definition at line 221 of file gsmtpserver.cpp.
G::Slot::Signal< const std::string &, const std::string & > & GSmtp::Server::eventSignal | ( | ) |
Returns a signal that indicates that something has happened.
Definition at line 226 of file gsmtpserver.cpp.
std::unique_ptr< GSmtp::ProtocolMessage > GSmtp::Server::newProtocolMessage | ( | GNet::ExceptionSink | es | ) |
Called by GSmtp::ServerPeer to construct a ProtocolMessage.
Definition at line 292 of file gsmtpserver.cpp.
void GSmtp::Server::report | ( | ) | const |
Generates helpful diagnostics after construction.
Definition at line 231 of file gsmtpserver.cpp.