An SMTP server class. More...
#include <gsmtpserver.h>
Classes | |
struct | Config |
A structure containing GSmtp::Server configuration parameters. More... | |
Public Types | |
typedef std::list< GNet::Address > | AddressList |
Public Types inherited from GNet::MultiServer | |
typedef std::list< Address > | AddressList |
typedef Server::PeerInfo | PeerInfo |
Public Member Functions | |
Server (MessageStore &store, const GAuth::Secrets &client_secrets, const GAuth::Secrets &server_secrets, Config server_config, std::string smtp_server_address, unsigned int smtp_connection_timeout, GSmtp::Client::Config client_config) | |
Constructor. More... | |
virtual | ~Server () |
Destructor. More... | |
void | report () const |
Generates helpful diagnostics after construction. More... | |
GNet::ServerPeer * | newPeer (GNet::Server::PeerInfo) |
From MultiServer. More... | |
G::Signal2< std::string, std::string > & | eventSignal () |
Returns a signal that indicates that something has happened. More... | |
Public Member Functions inherited from GNet::MultiServer | |
MultiServer (const AddressList &address_list, bool use_connection_lookup) | |
Constructor. More... | |
MultiServer () | |
Default constructor. Initialise with init(). More... | |
void | init (const AddressList &address_list) |
Initilisation after default construction. More... | |
virtual | ~MultiServer () |
Destructor. More... | |
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 addresses 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::Strings &, 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... | |
An SMTP server class.
Definition at line 92 of file gsmtpserver.h.
typedef std::list<GNet::Address> GSmtp::Server::AddressList |
Definition at line 95 of file gsmtpserver.h.
GSmtp::Server::Server | ( | MessageStore & | store, |
const GAuth::Secrets & | client_secrets, | ||
const GAuth::Secrets & | server_secrets, | ||
Config | server_config, | ||
std::string | smtp_server_address, | ||
unsigned int | smtp_connection_timeout, | ||
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 'smtp-server-address' parameter is given then all messages are forwarded immediately, using the specified client-side timeout values and client-side secrets.
If the 'smtp-server-address' parameter is empty then the timeout values are ignored.
The references are kept.
Definition at line 136 of file gsmtpserver.cpp.
|
virtual |
Destructor.
Definition at line 156 of file gsmtpserver.cpp.
G::Signal2< std::string, std::string > & GSmtp::Server::eventSignal | ( | ) |
Returns a signal that indicates that something has happened.
Definition at line 162 of file gsmtpserver.cpp.
|
virtual |
From MultiServer.
Implements GNet::MultiServer.
Definition at line 172 of file gsmtpserver.cpp.
References G_WARNING, GNet::Local::isLocal(), GNet::Server::PeerInfo::m_address, and GNet::Server::PeerInfo::m_name.
void GSmtp::Server::report | ( | ) | const |
Generates helpful diagnostics after construction.
Definition at line 167 of file gsmtpserver.cpp.