E-MailRelay
|
A concrete implementation of the ProtocolMessage interface that stores incoming messages in the message store and then immediately forwards them on to the downstream server. More...
#include <gprotocolmessageforward.h>
Public Member Functions | |
ProtocolMessageForward (GNet::ExceptionSink, MessageStore &store, FilterFactory &, std::unique_ptr< ProtocolMessage > pm, const GSmtp::Client::Config &client_config, const GAuth::SaslClientSecrets &client_secrets, const std::string &remote_server_address) | |
Constructor. More... | |
~ProtocolMessageForward () override | |
Destructor. More... | |
ProtocolMessageForward (const ProtocolMessageForward &)=delete | |
ProtocolMessageForward (ProtocolMessageForward &&)=delete | |
void | operator= (const ProtocolMessageForward &)=delete |
void | operator= (ProtocolMessageForward &&)=delete |
![]() | |
virtual | ~ProtocolMessage ()=default |
Destructor. | |
virtual DoneSignal & | doneSignal ()=0 |
Returns a signal which is raised once process() has completed. More... | |
virtual void | reset ()=0 |
Resets the object state as if just constructed. More... | |
virtual void | clear ()=0 |
Clears the message state and terminates any asynchronous message processing. More... | |
virtual MessageId | setFrom (const std::string &from_user, const std::string &from_auth)=0 |
Sets the message envelope 'from'. More... | |
virtual bool | addTo (VerifierStatus to_status)=0 |
Adds an envelope 'to'. More... | |
virtual void | addReceived (const std::string &)=0 |
Adds a 'received' line to the start of the content. More... | |
virtual bool | addText (const char *, std::size_t)=0 |
Adds text. More... | |
bool | addTextLine (const std::string &) |
A convenience function that calls addText() taking a string parameter and adding CR-LF. More... | |
virtual std::string | from () const =0 |
Returns the setFrom() string. More... | |
virtual void | process (const std::string &session_auth_id, const std::string &peer_socket_address, const std::string &peer_certificate)=0 |
Starts asynchronous processing of the message. More... | |
Protected Member Functions | |
ProtocolMessage::DoneSignal & | storageDoneSignal () |
Returns the signal which is used to signal that the storage is complete. More... | |
void | processDone (bool, const MessageId &, const std::string &, const std::string &) |
Called by derived classes that have intercepted the storageDoneSignal() when their own post-storage processing is complete. More... | |
Additional Inherited Members | |
![]() | |
using | DoneSignal = G::Slot::Signal< bool, const MessageId &, const std::string &, const std::string & > |
A concrete implementation of the ProtocolMessage interface that stores incoming messages in the message store and then immediately forwards them on to the downstream server.
The implementation delegates to an instance of the ProtocolMessageStore class (ie. its sibling class) to do the storage, and to an instance of the GSmtp::Client class to do the forwarding.
Definition at line 55 of file gprotocolmessageforward.h.
GSmtp::ProtocolMessageForward::ProtocolMessageForward | ( | GNet::ExceptionSink | es, |
MessageStore & | store, | ||
FilterFactory & | ff, | ||
std::unique_ptr< ProtocolMessage > | pm, | ||
const GSmtp::Client::Config & | client_config, | ||
const GAuth::SaslClientSecrets & | client_secrets, | ||
const std::string & | remote_server_address | ||
) |
Constructor.
The 'store' and 'client-secrets' references are kept.
Definition at line 30 of file gprotocolmessageforward.cpp.
|
override |
Destructor.
Definition at line 49 of file gprotocolmessageforward.cpp.
|
protected |
Called by derived classes that have intercepted the storageDoneSignal() when their own post-storage processing is complete.
Definition at line 110 of file gprotocolmessageforward.cpp.
|
protected |
Returns the signal which is used to signal that the storage is complete.
Derived classes can use this to intercept the storage-done signal emit()ed by the ProtocolMessageStore object.
Definition at line 57 of file gprotocolmessageforward.cpp.