Commit b49ee720 authored by Volker Krause's avatar Volker Krause Committed by Sandro Knauß
Browse files

Adapt to KSmtp moving encryption settings from LoginJob to Session

See ksmtp!5.
parent aabd283b
Pipeline #80980 passed with stage
in 6 minutes and 2 seconds
......@@ -33,7 +33,7 @@ set(KMAILTRANSPORT_LIB_VERSION ${PIM_VERSION})
set(KMIME_LIB_VERSION "5.18.40")
set(AKONADI_LIB_VERSION "5.18.41")
set(AKONADIMIME_LIB_VERSION "5.18.40")
set(KSMTP_LIB_VERSION "5.18.40")
set(KSMTP_LIB_VERSION "5.18.41")
set(KGAPI_LIB_VERSION "5.18.40")
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MailTransport")
......
......@@ -133,6 +133,20 @@ void SmtpJob::startSmtpJob()
d->session = new KSmtp::Session(transport()->host(), transport()->port());
d->session->setUseNetworkProxy(transport()->useProxy());
d->session->setUiProxy(d->uiProxy);
switch (transport()->encryption()) {
case Transport::EnumEncryption::None:
d->session->setEncryptionMode(KSmtp::Session::Unencrypted);
break;
case Transport::EnumEncryption::TLS:
d->session->setEncryptionMode(KSmtp::Session::STARTTLS);
break;
case Transport::EnumEncryption::SSL:
d->session->setEncryptionMode(KSmtp::Session::TLS);
break;
default:
qCWarning(MAILTRANSPORT_SMTP_LOG) << "Unknown encryption mode" << transport()->encryption();
break;
}
if (transport()->specifyHostname()) {
d->session->setCustomHostname(transport()->localHostname());
}
......@@ -295,21 +309,6 @@ void SmtpJobPrivate::doLogin()
break;
}
switch (q->transport()->encryption()) {
case Transport::EnumEncryption::None:
login->setEncryptionMode(KSmtp::LoginJob::Unencrypted);
break;
case Transport::EnumEncryption::TLS:
login->setEncryptionMode(KSmtp::LoginJob::STARTTLS);
break;
case Transport::EnumEncryption::SSL:
login->setEncryptionMode(KSmtp::LoginJob::SSLorTLS);
break;
default:
qCWarning(MAILTRANSPORT_SMTP_LOG) << "Unknown encryption mode" << q->transport()->encryption();
break;
}
q->connect(login, &KJob::result, q, &SmtpJob::slotResult);
q->addSubjob(login);
login->start();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment