E-MailRelay
Classes | Public Types | Public Member Functions | List of all members
GSmtp::Server Class Reference

An SMTP server class. More...

#include <gsmtpserver.h>

+ Inheritance diagram for GSmtp::Server:

Classes

struct  Config
 A structure containing GSmtp::Server configuration parameters. More...
 

Public Types

using AddressList = std::vector< GNet::Address >
 
- Public Types inherited from GNet::MultiServer
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< ProtocolMessagenewProtocolMessage (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
 
- Public Member Functions inherited from GNet::MultiServer
 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< ServerPeerdoNewPeer (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 Public Member Functions inherited from GNet::MultiServer
static bool canBind (const AddressList &listening_address_list, bool do_throw)
 Checks that all the specified addresses can be bound. More...
 
- Protected Member Functions inherited from GNet::MultiServer
virtual std::unique_ptr< ServerPeernewPeer (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...
 

Detailed Description

An SMTP server class.

Definition at line 49 of file gsmtpserver.h.

Member Typedef Documentation

◆ AddressList

using GSmtp::Server::AddressList = std::vector<GNet::Address>

Definition at line 52 of file gsmtpserver.h.

Constructor & Destructor Documentation

◆ Server()

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.

◆ ~Server()

GSmtp::Server::~Server ( )
override

Destructor.

Definition at line 221 of file gsmtpserver.cpp.

Member Function Documentation

◆ eventSignal()

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.

◆ newProtocolMessage()

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.

◆ report()

void GSmtp::Server::report ( ) const

Generates helpful diagnostics after construction.

Definition at line 231 of file gsmtpserver.cpp.


The documentation for this class was generated from the following files: