|
|
|
@ -13,7 +13,7 @@ namespace pEp {
|
|
|
|
|
pEpTransportMail::ConfigMail::ConfigMail(const std::string &userfile) : userfile{ userfile } {}
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------------------
|
|
|
|
|
//bool pEpTransportMail::log_enabled{ false };
|
|
|
|
|
bool pEpTransportMail::log_enabled{ false };
|
|
|
|
|
|
|
|
|
|
// Constructor
|
|
|
|
|
pEpTransportMail::pEpTransportMail(PEP_transport_id id) :
|
|
|
|
@ -28,12 +28,12 @@ namespace pEp {
|
|
|
|
|
login_smtp{ Login::smtps },
|
|
|
|
|
login_imap{ Login::imaps }
|
|
|
|
|
{
|
|
|
|
|
//pEpLogClass("called");
|
|
|
|
|
pEpLogClass("called");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void pEpTransportMail::configure(const Config &config)
|
|
|
|
|
{
|
|
|
|
|
//pEpLogClass("called");
|
|
|
|
|
pEpLogClass("called");
|
|
|
|
|
if (allCallbacksRegistered()) {
|
|
|
|
|
if (ConfigMail *cfg = dynamic_cast<ConfigMail *>(const_cast<Config *>(&config))) {
|
|
|
|
|
//login_imap = Login(Login::imaps, server, port, username, passphrase, auth_method);
|
|
|
|
@ -48,21 +48,21 @@ namespace pEp {
|
|
|
|
|
|
|
|
|
|
void pEpTransportMail::startup()
|
|
|
|
|
{
|
|
|
|
|
//pEpLogClass("called");
|
|
|
|
|
pEpLogClass("called");
|
|
|
|
|
throwInvalidState();
|
|
|
|
|
//peptox->startup();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void pEpTransportMail::shutdown()
|
|
|
|
|
{
|
|
|
|
|
//pEpLogClass("called");
|
|
|
|
|
pEpLogClass("called");
|
|
|
|
|
throwInvalidState();
|
|
|
|
|
//peptox->shutdown();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void pEpTransportMail::sendto(::message *msg)
|
|
|
|
|
{
|
|
|
|
|
//pEpLogClass("called");
|
|
|
|
|
pEpLogClass("called");
|
|
|
|
|
throwInvalidState();
|
|
|
|
|
if (msg == nullptr) {
|
|
|
|
|
throw std::runtime_error("sendto(): invalid message - null");
|
|
|
|
@ -143,7 +143,7 @@ namespace pEp {
|
|
|
|
|
|
|
|
|
|
::message *pEpTransportMail::recvnext()
|
|
|
|
|
{
|
|
|
|
|
//pEpLogClass("called");
|
|
|
|
|
pEpLogClass("called");
|
|
|
|
|
throwInvalidState();
|
|
|
|
|
|
|
|
|
|
::message *msg_pep = nullptr;
|
|
|
|
@ -228,7 +228,7 @@ namespace pEp {
|
|
|
|
|
//Register callbacks
|
|
|
|
|
void pEpTransportMail::signal_statuschange(CBStatusChange handler)
|
|
|
|
|
{
|
|
|
|
|
//pEpLogClass("called");
|
|
|
|
|
pEpLogClass("called");
|
|
|
|
|
if (!handler) {
|
|
|
|
|
throw std::runtime_error("invalid handler");
|
|
|
|
|
}
|
|
|
|
@ -239,7 +239,7 @@ namespace pEp {
|
|
|
|
|
|
|
|
|
|
void pEpTransportMail::signal_sendto_result(CBSendToResult handler)
|
|
|
|
|
{
|
|
|
|
|
//pEpLogClass("called");
|
|
|
|
|
pEpLogClass("called");
|
|
|
|
|
if (!handler) {
|
|
|
|
|
throw std::runtime_error("invalid handler");
|
|
|
|
|
}
|
|
|
|
@ -250,7 +250,7 @@ namespace pEp {
|
|
|
|
|
|
|
|
|
|
void pEpTransportMail::signal_incoming_message(CBIncomminMessage handler)
|
|
|
|
|
{
|
|
|
|
|
//pEpLogClass("called");
|
|
|
|
|
pEpLogClass("called");
|
|
|
|
|
if (!handler) {
|
|
|
|
|
throw std::runtime_error("invalid handler");
|
|
|
|
|
}
|
|
|
|
|