E-MailRelay
|
An SMTP server class. More...
#include <gsmtpserver.h>
Classes | |
struct | Config |
A configuration structure for GSmtp::Server. More... | |
Public Types | |
using | AddressList = std::vector< GNet::Address > |
![]() | |
using | AddressList = std::vector< Address > |
Public Member Functions | |
Server (GNet::EventState es, GStore::MessageStore &, FilterFactoryBase &, VerifierFactoryBase &, const GAuth::SaslClientSecrets &, const GAuth::SaslServerSecrets &, const Config &server_config, const std::string &forward_to, int forward_to_family, const GSmtp::Client::Config &client_config) | |
Constructor. More... | |
~Server () override | |
Destructor. More... | |
void | report (const std::string &group={}) const |
Generates helpful diagnostics after construction. More... | |
G::Slot::Signal< const std::string &, const std::string & > & | eventSignal () noexcept |
Returns a signal that indicates that something has happened. More... | |
std::unique_ptr< ProtocolMessage > | newProtocolMessage (GNet::EventState) |
Called by GSmtp::ServerPeer to construct a ProtocolMessage. More... | |
Config & | config () |
Exposes the configuration sub-object. More... | |
void | nodnsbl (unsigned int seconds) |
Clears the DNSBL configuration string for a period of time. More... | |
void | enable (bool) |
Disables or re-enables new SMTP sessions. More... | |
Server (const Server &)=delete | |
Server (Server &&)=delete | |
Server & | operator= (const Server &)=delete |
Server & | operator= (Server &&)=delete |
![]() | |
MultiServer (EventState es_listener, const G::StringArray &listen_list, unsigned int port, const std::string &server_type, ServerPeer::Config server_peer_config, Server::Config 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 (EventStateUnbound, ServerPeerInfo &&, const ServerInfo &) |
Pseudo-private method used by the pimple class. More... | |
MultiServer (const MultiServer &)=delete | |
MultiServer (MultiServer &&)=delete | |
MultiServer & | operator= (const MultiServer &)=delete |
MultiServer & | operator= (MultiServer &&)=delete |
Additional Inherited Members | |
![]() | |
virtual std::unique_ptr< ServerPeer > | newPeer (EventStateUnbound, ServerPeerInfo &&, ServerInfo)=0 |
A factory method which creates 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 std::string &group={}) const |
Writes to the system log a summary of the underlying server objects and their addresses. More... | |
An SMTP server class.
Definition at line 54 of file gsmtpserver.h.
using GSmtp::Server::AddressList = std::vector<GNet::Address> |
Definition at line 57 of file gsmtpserver.h.
GSmtp::Server::Server | ( | GNet::EventState | es, |
GStore::MessageStore & | store, | ||
FilterFactoryBase & | ff, | ||
VerifierFactoryBase & | vf, | ||
const GAuth::SaslClientSecrets & | client_secrets, | ||
const GAuth::SaslServerSecrets & | server_secrets, | ||
const Config & | server_config, | ||
const std::string & | forward_to, | ||
int | forward_to_family, | ||
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 as soon as they are received using the GSmtp::ProtocolMessageForward class and the given client configuration.
The forward-to-family is used if the forward-to address is a DNS name that needs to be resolved.
Definition at line 175 of file gsmtpserver.cpp.
|
override |
Destructor.
Definition at line 196 of file gsmtpserver.cpp.
GSmtp::Server::Config & GSmtp::Server::config | ( | ) |
Exposes the configuration sub-object.
Definition at line 202 of file gsmtpserver.cpp.
void GSmtp::Server::enable | ( | bool | b | ) |
Disables or re-enables new SMTP sessions.
When disabled new network connections are allowed but the SMTP protocol is disabled in some way.
Definition at line 260 of file gsmtpserver.cpp.
|
noexcept |
Returns a signal that indicates that something has happened.
Definition at line 208 of file gsmtpserver.cpp.
std::unique_ptr< GSmtp::ProtocolMessage > GSmtp::Server::newProtocolMessage | ( | GNet::EventState | es | ) |
Called by GSmtp::ServerPeer to construct a ProtocolMessage.
Definition at line 292 of file gsmtpserver.cpp.
void GSmtp::Server::nodnsbl | ( | unsigned int | seconds | ) |
Clears the DNSBL configuration string for a period of time.
Definition at line 254 of file gsmtpserver.cpp.
void GSmtp::Server::report | ( | const std::string & | group = {} | ) | const |
Generates helpful diagnostics after construction.
Definition at line 213 of file gsmtpserver.cpp.