21 #ifndef G_SMTP_CLIENT_H
22 #define G_SMTP_CLIENT_H
47 class ClientProtocol ;
91 void sendMessage( std::auto_ptr<StoredMessage> message ) ;
113 virtual bool onReceive(
const std::string & ) ;
116 virtual void onDelete(
const std::string & ,
bool ) ;
122 virtual void onSecure(
const std::string & ) ;
126 virtual bool protocolSend(
const std::string & ,
size_t ,
bool ) ;
127 void protocolDone( std::string ,
int ) ;
128 void preprocessorStart() ;
129 void preprocessorDone(
bool ) ;
130 static const std::string & crlf() ;
133 void messageFail(
const std::string & ,
int = 0 ) ;
134 void messageDestroy() ;
136 void logCertificate(
const std::string & ) ;
140 std::auto_ptr<Processor> m_processor ;
141 std::auto_ptr<StoredMessage> m_message ;
144 bool m_secure_tunnel ;
void sendMessage(std::auto_ptr< StoredMessage > message)
Starts sending the given message.
SMTP and message-store classes.
virtual void onConnect()
Final override from GNet::SimpleClient.
virtual bool onReceive(const std::string &)
Final override from GNet::Client.
std::string processor_address
ClientProtocol::Config client_protocol_config
G::Signal1< std::string > & messageDoneSignal()
Returns a signal that indicates that sendMessage() has completed or failed.
The Address class encapsulates an IP transport address.
An abstract class for messages which have come from the store.
A class that holds a host/service name pair and optionally the results of a name-to-address lookup...
A structure containing GSmtp::ClientProtocol configuration parameters.
Config(std::string, unsigned int, GNet::Address, ClientProtocol::Config, unsigned int, unsigned int, bool)
An interface used by ClientProtocol to send protocol messages.
unsigned int secure_connection_timeout
virtual ~Client()
Destructor.
virtual void onSecure(const std::string &)
Final override from GNet::SocketProtocol.
Implements the client-side SMTP protocol.
Client(const GNet::ResolverInfo &remote, const GAuth::Secrets &secrets, Config config)
Constructor.
unsigned int processor_timeout
A class which allows SMTP messages (envelope+content) to be stored and retrieved. ...
A simple interface to a store of secrets as used in authentication.
unsigned int connection_timeout
A structure containing GSmtp::Client configuration parameters.
A class which acts as an SMTP client, extracting messages from a message store and forwarding them to...
virtual void onDelete(const std::string &, bool)
Final override from GNet::HeapClient.
virtual void onSendComplete()
Final override from GNet::BufferedClient.
#define G_EXCEPTION(class_name, description)
define as a function rather than a type if optimising for size
void sendMessagesFrom(MessageStore &store)
Sends all messages from the given message store once connected.
GNet::Address local_address
A HeapClient class that adds slot/signal signalling, connection/response timeouts, and input line buffering.
An iterator class for GSmtp::MessageStore.