Commit 405189e5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix import encryption smtp

parent 702be3ee
Pipeline #95870 passed with stage
in 7 minutes and 48 seconds
......@@ -13,7 +13,6 @@
#include <KIdentityManagement/IdentityManager>
#include <MailCommon/FilterImporterExporter>
#include <MailCommon/FilterManager>
#include <MailTransport/TransportManager>
#include <PimCommonAkonadi/CreateResource>
using namespace Akonadi;
......@@ -131,6 +130,19 @@ void ImportMailJobInterfaceImpl::importCustomMailTransport(const QString &identi
}
}
int ImportMailJobInterfaceImpl::convertEncryptionEnum(int val)
{
switch(val) {
case 0:
return MailTransport::Transport::EnumEncryption::None;
case 1:
return MailTransport::Transport::EnumEncryption::TLS;
case 2:
return MailTransport::Transport::EnumEncryption::SSL;
}
return MailTransport::Transport::EnumEncryption::None;
}
void ImportMailJobInterfaceImpl::importSmtpMailTransport(const SmtpMailTransport &smtpMailTransport, int defaultTransport, int transportId)
{
MailTransport::Transport *mt = MailTransport::TransportManager::self()->createTransport();
......@@ -145,7 +157,7 @@ void ImportMailJobInterfaceImpl::importSmtpMailTransport(const SmtpMailTransport
mt->setSpecifySenderOverwriteAddress(smtpMailTransport.specifySenderOverwriteAddress());
mt->setStorePassword(smtpMailTransport.storePassword());
mt->setSenderOverwriteAddress(smtpMailTransport.senderOverwriteAddress());
mt->setEncryption(smtpMailTransport.encryption());
mt->setEncryption(convertEncryptionEnum(smtpMailTransport.encryption()));
mt->setAuthenticationType(smtpMailTransport.authenticationType());
addMailTransport(mt, defaultTransport, transportId);
}
......
......@@ -13,6 +13,7 @@
#include <KArchive>
#include <QHash>
#include <QStringList>
#include <MailTransport/TransportManager>
class ArchiveStorage;
namespace KIdentityManagement
{
......@@ -48,6 +49,7 @@ protected:
Q_REQUIRED_RESULT QString configLocation() const override;
private:
Q_REQUIRED_RESULT int convertEncryptionEnum(int val);
Q_REQUIRED_RESULT QString uniqueIdentityName(const QString &name);
KIdentityManagement::IdentityManager *const mIdentityManager;
};
Supports Markdown
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