Commit d9fabd79 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

BUG 442884: Fix DSN support

parent 0014b8bd
Pipeline #82498 passed with stage
in 9 minutes and 5 seconds
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(PIM_VERSION "5.18.40")
set(PIM_VERSION "5.18.41")
project(MailTransport VERSION ${PIM_VERSION})
# ECM setup
......@@ -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.41")
set(KSMTP_LIB_VERSION "5.18.42")
set(KGAPI_LIB_VERSION "5.18.40")
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MailTransport")
......
......@@ -323,6 +323,7 @@ void SmtpJob::startSendJob()
send->setCc(cc());
send->setBcc(bcc());
send->setData(data());
send->setDeliveryStatusNotification(deliveryStatusNotification());
addSubjob(send);
send->start();
......
......@@ -44,16 +44,16 @@ public:
void loadPlugin(MailTransportPluginInfo *item);
QVector<MailTransport::TransportAbstractPlugin *> pluginsList() const;
QVector<MailTransportPluginInfo> mPluginList;
bool initializePlugins();
void initializePlugins();
private:
TransportPluginManager *q;
};
bool TransportPluginManagerPrivate::initializePlugins()
void TransportPluginManagerPrivate::initializePlugins()
{
if (!mPluginList.isEmpty()) {
return true;
return;
}
const QVector<KPluginMetaData> plugins = KPluginMetaData::findPlugins(QStringLiteral("mailtransport"));
......@@ -77,7 +77,6 @@ bool TransportPluginManagerPrivate::initializePlugins()
for (QVector<MailTransportPluginInfo>::iterator it = mPluginList.begin(); it != end; ++it) {
loadPlugin(&(*it));
}
return true;
}
void TransportPluginManagerPrivate::loadPlugin(MailTransportPluginInfo *item)
......
......@@ -21,6 +21,7 @@ public:
QStringList cc;
QStringList bcc;
QByteArray data;
bool dsn = false;
Transport *transport = nullptr;
QBuffer *buffer = nullptr;
};
......@@ -69,6 +70,11 @@ Transport *TransportJob::transport() const
return d->transport;
}
void TransportJob::setDeliveryStatusNotification(bool enabled)
{
d->dsn = enabled;
}
QString TransportJob::sender() const
{
return d->sender;
......@@ -105,6 +111,11 @@ QBuffer *TransportJob::buffer()
return d->buffer;
}
bool TransportJob::deliveryStatusNotification() const
{
return d->dsn;
}
void TransportJob::start()
{
if (!transport()->isValid()) {
......
......@@ -77,6 +77,11 @@ public:
*/
Transport *transport() const;
/**
Sets the content of the mail.
*/
void setDeliveryStatusNotification(bool enabled);
protected:
/**
Creates a new mail transport job.
......@@ -123,6 +128,11 @@ protected:
*/
virtual void doStart() = 0;
/**
Returns true if DSN is enabled.
*/
Q_REQUIRED_RESULT bool deliveryStatusNotification() const;
private:
//@cond PRIVATE
class Private;
......
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