E-MailRelay
|
A class for forwarding messages from a message store that manages a GSmtp::Client instance, connecting and disconnecting as necessary to do routing and re-authentication. More...
#include <gsmtpforward.h>
Public Types | |
using | Config = GSmtp::Client::Config |
Public Member Functions | |
Forward (GNet::EventState, GStore::MessageStore &store, FilterFactoryBase &, const GNet::Location &forward_to_default, const GAuth::SaslClientSecrets &, const Config &config) | |
Constructor. More... | |
Forward (GNet::EventState, FilterFactoryBase &, const GNet::Location &forward_to_default, const GAuth::SaslClientSecrets &, const Config &config) | |
Constructor. More... | |
virtual | ~Forward () |
Destructor. More... | |
void | sendMessage (std::unique_ptr< GStore::StoredMessage > message) |
Starts sending the given message. More... | |
void | quitAndFinish () |
Finishes a sendMessage() sequence. More... | |
G::Slot::Signal< const Client::MessageDoneInfo & > & | messageDoneSignal () noexcept |
Returns a signal that indicates that sendMessage() has completed or failed. More... | |
G::Slot::Signal< const std::string &, const std::string &, const std::string & > & | eventSignal () noexcept |
See GNet::Client::eventSignal() More... | |
void | doOnDelete (const std::string &reason, bool done) |
Used by owning ClientPtr when handling an exception. More... | |
bool | finished () const |
Returns true after quitAndFinish(). More... | |
std::string | peerAddressString () const |
Returns the Client's peerAddressString() if currently connected. More... | |
Forward (const Forward &)=delete | |
Forward (Forward &&)=delete | |
Forward & | operator= (const Forward &)=delete |
Forward & | operator= (Forward &&)=delete |
A class for forwarding messages from a message store that manages a GSmtp::Client instance, connecting and disconnecting as necessary to do routing and re-authentication.
Definition at line 54 of file gsmtpforward.h.
Definition at line 57 of file gsmtpforward.h.
GSmtp::Forward::Forward | ( | GNet::EventState | es, |
GStore::MessageStore & | store, | ||
FilterFactoryBase & | ff, | ||
const GNet::Location & | forward_to_default, | ||
const GAuth::SaslClientSecrets & | secrets, | ||
const Config & | config | ||
) |
Constructor.
Starts sending the first message from the message store.
Once all messages have been sent the client will throw GNet::Done. See GNet::ClientPtr.
Do not use sendMessage(). The messageDoneSignal() is not emitted.
Definition at line 29 of file gsmtpforward.cpp.
GSmtp::Forward::Forward | ( | GNet::EventState | es, |
FilterFactoryBase & | ff, | ||
const GNet::Location & | forward_to_default, | ||
const GAuth::SaslClientSecrets & | secrets, | ||
const Config & | config | ||
) |
Constructor.
Use sendMessage() immediately after construction.
A messageDoneSignal() is emitted when the message has been sent, allowing the next sendMessage().
Use quitAndFinish() at the end.
Definition at line 39 of file gsmtpforward.cpp.
|
virtual |
Destructor.
Definition at line 60 of file gsmtpforward.cpp.
void GSmtp::Forward::doOnDelete | ( | const std::string & | reason, |
bool | done | ||
) |
Used by owning ClientPtr when handling an exception.
Definition at line 307 of file gsmtpforward.cpp.
|
noexcept |
See GNet::Client::eventSignal()
Definition at line 370 of file gsmtpforward.cpp.
bool GSmtp::Forward::finished | ( | ) | const |
Returns true after quitAndFinish().
Definition at line 330 of file gsmtpforward.cpp.
|
noexcept |
Returns a signal that indicates that sendMessage() has completed or failed.
Definition at line 365 of file gsmtpforward.cpp.
std::string GSmtp::Forward::peerAddressString | ( | ) | const |
Returns the Client's peerAddressString() if currently connected.
Definition at line 324 of file gsmtpforward.cpp.
void GSmtp::Forward::quitAndFinish | ( | ) |
Finishes a sendMessage() sequence.
Definition at line 239 of file gsmtpforward.cpp.
void GSmtp::Forward::sendMessage | ( | std::unique_ptr< GStore::StoredMessage > | message | ) |
Starts sending the given message.
Cannot be called if there is a message already in the pipeline.
The messageDoneSignal() is used to indicate that the message filtering has finished or failed.
The message is fail()ed if it cannot be sent. If this object is deleted before the message is sent the message is neither fail()ed or destroy()ed.
Does nothing if there are no message recipients.
Definition at line 114 of file gsmtpforward.cpp.