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

typedef std::vector< GNet::Address > AddressList
 
- Public Types inherited from GNet::MultiServer
typedef std::vector< Address > AddressList
 
typedef Server::PeerInfo PeerInfo
 

Public Member Functions

 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. More...
 
virtual ~Server ()
 Destructor.
 
void report () const
 Generates helpful diagnostics after construction.
 
G::Slot::Signal2< std::string, std::string > & eventSignal ()
 Returns a signal that indicates that something has happened.
 
unique_ptr< ProtocolMessage > newProtocolMessage (ServerPeer &)
 Called by GSmtp::ServerPeer to construct a ProtocolMessage.
 
- Public Member Functions inherited from GNet::MultiServer
 MultiServer (ExceptionHandler &, const AddressList &address_list)
 Constructor. More...
 
 MultiServer (ExceptionHandler &)
 Default constructor. Initialise with init().
 
void init (const AddressList &address_list)
 Initilisation after default construction. More...
 
virtual ~MultiServer ()
 Destructor.
 
std::pair< bool, Address > firstAddress () const
 Returns the first listening address. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GNet::MultiServer
static bool canBind (const AddressList &listening_address_list, bool do_throw)
 Checks that the specified addresses can be bound. More...
 
static AddressList addressList (const Address &)
 A trivial convenience fuction that returns the given address as a single-element list. More...
 
static AddressList addressList (const AddressList &, unsigned int port)
 Returns the given list of addresses with the port set correctly. More...
 
static AddressList addressList (const G::StringArray &, unsigned int port)
 A convenience function that returns a list of listening addresses given a list of listening interfaces and a port number. More...
 
- Protected Member Functions inherited from GNet::MultiServer
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 &server_type) 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.

Constructor & Destructor Documentation

GSmtp::Server::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.

Listens on the given port number using INET_ANY if '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.

The references are kept.

Definition at line 143 of file gsmtpserver.cpp.


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