21 #ifndef G_SMTP_CLIENT_H
22 #define G_SMTP_CLIENT_H
45 class ClientProtocol ;
57 std::string filter_address ;
58 unsigned int filter_timeout ;
59 bool bind_local_address ;
62 unsigned int connection_timeout ;
63 unsigned int secure_connection_timeout ;
65 Config( std::string filter_address ,
unsigned int filter_timeout ,
66 bool bind_local_address ,
const GNet::Address & local_address ,
68 unsigned int connection_timeout ,
unsigned int secure_connection_timeout ,
69 bool secure_tunnel ) ;
98 void sendMessage( unique_ptr<StoredMessage> message ) ;
117 virtual bool onReceive(
const char * ,
size_t ,
size_t )
override ;
120 virtual void onDelete(
const std::string & )
override ;
126 virtual void onSecure(
const std::string & )
override ;
130 virtual bool protocolSend(
const std::string & ,
size_t ,
bool )
override ;
131 void protocolDone(
int , std::string , std::string ) ;
133 void filterDone(
int ) ;
136 void messageFail(
int = 0 ,
const std::string & = std::string() ) ;
137 void messageDestroy() ;
139 void logCertificate(
const std::string & ) ;
143 unique_ptr<Filter> m_filter ;
144 unique_ptr<StoredMessage> m_message ;
147 bool m_secure_tunnel ;
149 unsigned int m_message_count ;
virtual void onDelete(const std::string &) override
Override from GNet::HeapClient.
SMTP and message-store classes.
virtual void onSecure(const std::string &) override
Override from GNet::SocketProtocol.
void sendMessage(unique_ptr< StoredMessage > message)
Starts sending the given message.
The GNet::Address class encapsulates a TCP/UDP transport address.
G::Slot::Signal1< std::string > & messageDoneSignal()
Returns a signal that indicates that sendMessage() has completed or failed.
An abstract interface for messages which have come from the store.
A structure containing GSmtp::ClientProtocol configuration parameters.
virtual void onConnect() override
Override from GNet::SimpleClient.
An interface used by ClientProtocol to send protocol messages.
virtual ~Client()
Destructor.
A class that holds a host/service name pair and the preferred address family (if any), and also the results of a name-to-address lookup, ie.
Implements the client-side SMTP protocol.
Client(const GNet::Location &remote, const GAuth::Secrets &secrets, Config config)
Constructor.
A class which allows SMTP messages to be stored and retrieved.
A simple interface for a store of secrets used in authentication.
virtual bool onReceive(const char *, size_t, size_t) override
Override from GNet::Client.
virtual void onSendComplete() override
Override from GNet::BufferedClient.
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...
void sendMessagesFrom(MessageStore &store)
Sends all messages from the given message store once connected.
A HeapClient class that adds slot/signal signalling, connection/response timeouts, and input line buffering.
An iterator class for GSmtp::MessageStore.