Commit 284def65 authored by flypig's avatar flypig

Merge branch 'jb32000' into 'master'

Rebase on upstream after fix to decrease count on EXPUNGE

See merge request mer-core/messagingframework!31
parents 41f18511 12659edb
From 861537a78563e2a4cc92bcd1913f021421b7b8e6 Mon Sep 17 00:00:00 2001
From 39a360d49653006e951b96315aa0e4587f9a6fcd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Val=C3=A9rio=20Val=C3=A9rio?= <valerio.valerio@jolla.com>
Date: Mon, 23 Feb 2015 13:08:24 +0200
Subject: [PATCH 01/19] Stop _incomingDataTimer when imapprotocol object is
Subject: [PATCH 01/17] Stop _incomingDataTimer when imapprotocol object is
destroyed.
A crash occurs in case the timer is active and the object is destroyed.
......@@ -10,10 +10,10 @@ A crash occurs in case the timer is active and the object is destroyed.
1 file changed, 3 insertions(+)
diff --git a/src/plugins/messageservices/imap/imapprotocol.cpp b/src/plugins/messageservices/imap/imapprotocol.cpp
index 6de98d68..2c945d3f 100644
index 4df62a5..984e263 100644
--- a/src/plugins/messageservices/imap/imapprotocol.cpp
+++ b/src/plugins/messageservices/imap/imapprotocol.cpp
@@ -3012,6 +3012,9 @@ ImapProtocol::ImapProtocol()
@@ -3019,6 +3019,9 @@ ImapProtocol::ImapProtocol()
ImapProtocol::~ImapProtocol()
{
......@@ -24,5 +24,5 @@ index 6de98d68..2c945d3f 100644
delete _fsm;
}
--
2.17.2
1.8.3-rc3
From 036c88b752d8926f1a699452a121f88c211c92ce Mon Sep 17 00:00:00 2001
From bd8c9b6476c2ce24179c39b1c7624a0de260627a Mon Sep 17 00:00:00 2001
From: Pekka Vuorela <pekka.vuorela@jolla.com>
Date: Mon, 13 Aug 2018 15:45:24 +0300
Subject: [PATCH 02/19] Introduce acceptUntrustedCertificates() configuration.
Subject: [PATCH 02/17] Introduce acceptUntrustedCertificates() configuration.
---
src/libraries/qmfclient/qmailserviceaction.h | 2 ++
.../qmfmessageserver/qmailtransport.cpp | 29 +++++++++++++++----
.../qmfmessageserver/qmailtransport.h | 9 +++++-
.../imap/imapconfiguration.cpp | 14 +++++++++
.../messageservices/imap/imapconfiguration.h | 5 ++++
.../messageservices/imap/imapprotocol.cpp | 10 ++++++-
.../messageservices/imap/imaptransport.cpp | 15 ----------
.../messageservices/imap/imaptransport.h | 5 ----
src/plugins/messageservices/pop/popclient.cpp | 16 ++++++++++
.../messageservices/pop/popconfiguration.cpp | 13 +++++++++
.../messageservices/pop/popconfiguration.h | 5 ++++
.../messageservices/smtp/smtpclient.cpp | 10 +++++++
.../smtp/smtpconfiguration.cpp | 10 +++++++
.../messageservices/smtp/smtpconfiguration.h | 2 ++
src/libraries/qmfclient/qmailserviceaction.h | 2 ++
src/libraries/qmfmessageserver/qmailtransport.cpp | 29 +++++++++++++++++-----
src/libraries/qmfmessageserver/qmailtransport.h | 9 ++++++-
.../messageservices/imap/imapconfiguration.cpp | 14 +++++++++++
.../messageservices/imap/imapconfiguration.h | 5 ++++
src/plugins/messageservices/imap/imapprotocol.cpp | 10 +++++++-
src/plugins/messageservices/imap/imaptransport.cpp | 15 -----------
src/plugins/messageservices/imap/imaptransport.h | 5 ----
src/plugins/messageservices/pop/popclient.cpp | 16 ++++++++++++
.../messageservices/pop/popconfiguration.cpp | 13 ++++++++++
src/plugins/messageservices/pop/popconfiguration.h | 5 ++++
src/plugins/messageservices/smtp/smtpclient.cpp | 10 ++++++++
.../messageservices/smtp/smtpconfiguration.cpp | 10 ++++++++
.../messageservices/smtp/smtpconfiguration.h | 2 ++
14 files changed, 117 insertions(+), 28 deletions(-)
diff --git a/src/libraries/qmfclient/qmailserviceaction.h b/src/libraries/qmfclient/qmailserviceaction.h
index 3f6a1421..6ba4020e 100644
index 3f6a142..6ba4020 100644
--- a/src/libraries/qmfclient/qmailserviceaction.h
+++ b/src/libraries/qmfclient/qmailserviceaction.h
@@ -99,6 +99,8 @@ public:
......@@ -34,7 +34,7 @@ index 3f6a1421..6ba4020e 100644
};
diff --git a/src/libraries/qmfmessageserver/qmailtransport.cpp b/src/libraries/qmfmessageserver/qmailtransport.cpp
index e2699b24..b9d8e52a 100644
index e2699b2..b9d8e52 100644
--- a/src/libraries/qmfmessageserver/qmailtransport.cpp
+++ b/src/libraries/qmfmessageserver/qmailtransport.cpp
@@ -47,6 +47,7 @@
......@@ -102,7 +102,7 @@ index e2699b24..b9d8e52a 100644
/*! \internal */
diff --git a/src/libraries/qmfmessageserver/qmailtransport.h b/src/libraries/qmfmessageserver/qmailtransport.h
index 9b56ed64..f8113661 100644
index 9b56ed6..f811366 100644
--- a/src/libraries/qmfmessageserver/qmailtransport.h
+++ b/src/libraries/qmfmessageserver/qmailtransport.h
@@ -35,6 +35,9 @@
......@@ -143,7 +143,7 @@ index 9b56ed64..f8113661 100644
#endif
diff --git a/src/plugins/messageservices/imap/imapconfiguration.cpp b/src/plugins/messageservices/imap/imapconfiguration.cpp
index b4004bd6..07289a1c 100644
index b4004bd..07289a1 100644
--- a/src/plugins/messageservices/imap/imapconfiguration.cpp
+++ b/src/plugins/messageservices/imap/imapconfiguration.cpp
@@ -198,6 +198,15 @@ void ImapConfiguration::setSearchLimit(int limit)
......@@ -175,7 +175,7 @@ index b4004bd6..07289a1c 100644
void ImapConfigurationEditor::setDeleteMail(bool b)
diff --git a/src/plugins/messageservices/imap/imapconfiguration.h b/src/plugins/messageservices/imap/imapconfiguration.h
index f0c0569a..69dc8ad1 100644
index f0c0569..69dc8ad 100644
--- a/src/plugins/messageservices/imap/imapconfiguration.h
+++ b/src/plugins/messageservices/imap/imapconfiguration.h
@@ -85,6 +85,10 @@ public:
......@@ -198,10 +198,10 @@ index f0c0569a..69dc8ad1 100644
void setDeleteMail(bool b);
diff --git a/src/plugins/messageservices/imap/imapprotocol.cpp b/src/plugins/messageservices/imap/imapprotocol.cpp
index 2c945d3f..35614ea5 100644
index 984e263..f82df5a 100644
--- a/src/plugins/messageservices/imap/imapprotocol.cpp
+++ b/src/plugins/messageservices/imap/imapprotocol.cpp
@@ -3053,10 +3053,18 @@ bool ImapProtocol::open( const ImapConfiguration& config, qint64 bufferSize)
@@ -3060,10 +3060,18 @@ bool ImapProtocol::open( const ImapConfiguration& config, qint64 bufferSize)
this, SLOT(connected(QMailTransport::EncryptType)));
connect(_transport, SIGNAL(readyRead()),
this, SLOT(incomingData()));
......@@ -222,7 +222,7 @@ index 2c945d3f..35614ea5 100644
qMailLog(IMAP) << objectName() << "Setting read buffer size to" << bufferSize;
_transport->socket().setReadBufferSize(bufferSize);
diff --git a/src/plugins/messageservices/imap/imaptransport.cpp b/src/plugins/messageservices/imap/imaptransport.cpp
index aaa2a97f..7bfbea06 100644
index aaa2a97..7bfbea0 100644
--- a/src/plugins/messageservices/imap/imaptransport.cpp
+++ b/src/plugins/messageservices/imap/imaptransport.cpp
@@ -317,21 +317,6 @@ void ImapTransport::imapClose()
......@@ -248,7 +248,7 @@ index aaa2a97f..7bfbea06 100644
{
#if 0
diff --git a/src/plugins/messageservices/imap/imaptransport.h b/src/plugins/messageservices/imap/imaptransport.h
index a1c50426..50c12e51 100644
index a1c5042..50c12e5 100644
--- a/src/plugins/messageservices/imap/imaptransport.h
+++ b/src/plugins/messageservices/imap/imaptransport.h
@@ -68,11 +68,6 @@ public:
......@@ -264,7 +264,7 @@ index a1c50426..50c12e51 100644
void test();
diff --git a/src/plugins/messageservices/pop/popclient.cpp b/src/plugins/messageservices/pop/popclient.cpp
index 16562e0b..595c62a9 100644
index 85ac855..b8aa5c7 100644
--- a/src/plugins/messageservices/pop/popclient.cpp
+++ b/src/plugins/messageservices/pop/popclient.cpp
@@ -112,6 +112,10 @@ void PopClient::createTransport()
......@@ -314,7 +314,7 @@ index 16562e0b..595c62a9 100644
}
diff --git a/src/plugins/messageservices/pop/popconfiguration.cpp b/src/plugins/messageservices/pop/popconfiguration.cpp
index b56dba07..5c6754f9 100644
index b56dba0..5c6754f 100644
--- a/src/plugins/messageservices/pop/popconfiguration.cpp
+++ b/src/plugins/messageservices/pop/popconfiguration.cpp
@@ -99,6 +99,14 @@ bool PopConfiguration::intervalCheckRoamingEnabled() const
......@@ -345,7 +345,7 @@ index b56dba07..5c6754f9 100644
void PopConfigurationEditor::setDeleteMail(bool b)
diff --git a/src/plugins/messageservices/pop/popconfiguration.h b/src/plugins/messageservices/pop/popconfiguration.h
index 1644faad..fe0119c3 100644
index 1644faa..fe0119c 100644
--- a/src/plugins/messageservices/pop/popconfiguration.h
+++ b/src/plugins/messageservices/pop/popconfiguration.h
@@ -67,6 +67,10 @@ public:
......@@ -368,7 +368,7 @@ index 1644faad..fe0119c3 100644
void setDeleteMail(bool b);
diff --git a/src/plugins/messageservices/smtp/smtpclient.cpp b/src/plugins/messageservices/smtp/smtpclient.cpp
index 3560881d..876247d7 100644
index 2789397..9e1e219 100644
--- a/src/plugins/messageservices/smtp/smtpclient.cpp
+++ b/src/plugins/messageservices/smtp/smtpclient.cpp
@@ -201,10 +201,20 @@ void SmtpClient::newConnection()
......@@ -393,7 +393,7 @@ index 3560881d..876247d7 100644
QMailServiceAction::Status::ErrorCode SmtpClient::addMail(const QMailMessage& mail)
diff --git a/src/plugins/messageservices/smtp/smtpconfiguration.cpp b/src/plugins/messageservices/smtp/smtpconfiguration.cpp
index e8807cc7..23d43949 100644
index e8807cc..23d4394 100644
--- a/src/plugins/messageservices/smtp/smtpconfiguration.cpp
+++ b/src/plugins/messageservices/smtp/smtpconfiguration.cpp
@@ -66,6 +66,11 @@ int SmtpConfiguration::smtpPort() const
......@@ -421,7 +421,7 @@ index e8807cc7..23d43949 100644
{
setValue("smtpusername", str);
diff --git a/src/plugins/messageservices/smtp/smtpconfiguration.h b/src/plugins/messageservices/smtp/smtpconfiguration.h
index e8b28a6b..ed115d53 100644
index e8b28a6..ed115d5 100644
--- a/src/plugins/messageservices/smtp/smtpconfiguration.h
+++ b/src/plugins/messageservices/smtp/smtpconfiguration.h
@@ -69,6 +69,7 @@ public:
......@@ -441,5 +441,5 @@ index e8b28a6b..ed115d53 100644
void setSmtpPassword(const QString& password);
void setSmtpAuthentication(int t);
--
2.17.2
1.8.3-rc3
From ff786f09e3d6edd8a11b173f4ce6cb9e7917f971 Mon Sep 17 00:00:00 2001
From 7f641c940ef2ca28f1c21a245870f4c56721c280 Mon Sep 17 00:00:00 2001
From: Valerio Valerio <valerio.valerio@jollamobile.com>
Date: Tue, 30 Apr 2013 14:38:17 +0300
Subject: [PATCH 03/19] fix tests installation path.
Subject: [PATCH 03/17] fix tests installation path.
---
.../tst_messageserver/tst_messageserver.pro | 2 +-
tests/qt5/tests.xml | 532 +++++++++---------
tests/tests.pri | 2 +-
tests/tests.pro | 2 +-
tests/tests.xml | 532 +++++++++---------
tests/tst_python_email/tst_python_email.pro | 2 +-
benchmarks/tst_messageserver/tst_messageserver.pro | 2 +-
tests/qt5/tests.xml | 532 ++++++++++-----------
tests/tests.pri | 2 +-
tests/tests.pro | 2 +-
tests/tests.xml | 532 ++++++++++-----------
tests/tst_python_email/tst_python_email.pro | 2 +-
6 files changed, 536 insertions(+), 536 deletions(-)
diff --git a/benchmarks/tst_messageserver/tst_messageserver.pro b/benchmarks/tst_messageserver/tst_messageserver.pro
index 2d50131a..1dc2ddd5 100644
index 2d50131..1dc2ddd 100644
--- a/benchmarks/tst_messageserver/tst_messageserver.pro
+++ b/benchmarks/tst_messageserver/tst_messageserver.pro
@@ -2,7 +2,7 @@ TEMPLATE = app
......@@ -26,7 +26,7 @@ index 2d50131a..1dc2ddd5 100644
BASE=../../
include($$BASE/common.pri)
diff --git a/tests/qt5/tests.xml b/tests/qt5/tests.xml
index ffbb593f..ac9464a6 100644
index ffbb593..ac9464a 100644
--- a/tests/qt5/tests.xml
+++ b/tests/qt5/tests.xml
@@ -5,123 +5,123 @@
......@@ -1462,7 +1462,7 @@ index ffbb593f..ac9464a6 100644
<environments>
<scratchbox>true</scratchbox>
diff --git a/tests/tests.pri b/tests/tests.pri
index 623b19ca..1d3ba39e 100644
index 623b19c..1d3ba39 100644
--- a/tests/tests.pri
+++ b/tests/tests.pri
@@ -3,7 +3,7 @@ QT += testlib
......@@ -1475,7 +1475,7 @@ index 623b19ca..1d3ba39e 100644
include(../common.pri)
diff --git a/tests/tests.pro b/tests/tests.pro
index cac44948..cae08159 100644
index cac4494..cae0815 100644
--- a/tests/tests.pro
+++ b/tests/tests.pro
@@ -41,5 +41,5 @@ CONFIG += unittest
......@@ -1486,7 +1486,7 @@ index cac44948..cae08159 100644
+test_description.path = /opt/tests/qmf-qt5/test-definition
INSTALLS += test_description
diff --git a/tests/tests.xml b/tests/tests.xml
index 3a708ed0..b8fff814 100644
index 3a708ed..b8fff81 100644
--- a/tests/tests.xml
+++ b/tests/tests.xml
@@ -5,123 +5,123 @@
......@@ -2922,7 +2922,7 @@ index 3a708ed0..b8fff814 100644
<environments>
<scratchbox>true</scratchbox>
diff --git a/tests/tst_python_email/tst_python_email.pro b/tests/tst_python_email/tst_python_email.pro
index 4cde1fe3..204ecd5a 100644
index 4cde1fe..204ecd5 100644
--- a/tests/tst_python_email/tst_python_email.pro
+++ b/tests/tst_python_email/tst_python_email.pro
@@ -4,7 +4,7 @@ TARGET = tst_python_email
......@@ -2935,5 +2935,5 @@ index 4cde1fe3..204ecd5a 100644
INSTALLS += testdata
--
2.17.2
1.8.3-rc3
This diff is collapsed.
From b444c7fe216da0b94f67f68786ab6ed4231b1dc1 Mon Sep 17 00:00:00 2001
From 428c566dc26d64b06dc0d560bc804c3f8754e222 Mon Sep 17 00:00:00 2001
From: Evgeny Karpov <evgeny.karpov@oss.tieto.com>
Date: Thu, 24 Oct 2013 09:37:30 +0000
Subject: [PATCH 05/19] Start messageserver on system startup in case there are
Subject: [PATCH 05/17] Start messageserver on system startup in case there are
email accounts present
Squashed:
......@@ -16,11 +16,11 @@ Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Squashed:
Start messageserver only after all accounts related services. Contributes JB#28613
---
src/tools/accountscheck/accountscheck.cpp | 63 +++++++++++++++++++
src/tools/accountscheck/accountscheck.pro | 19 ++++++
.../messageserver5-accounts-check.service | 12 ++++
src/tools/systemd/messageserver5.service | 15 +++++
src/tools/tools.pro | 4 ++
src/tools/accountscheck/accountscheck.cpp | 63 ++++++++++++++++++++++
src/tools/accountscheck/accountscheck.pro | 19 +++++++
.../systemd/messageserver5-accounts-check.service | 12 +++++
src/tools/systemd/messageserver5.service | 15 ++++++
src/tools/tools.pro | 4 ++
5 files changed, 113 insertions(+)
create mode 100644 src/tools/accountscheck/accountscheck.cpp
create mode 100644 src/tools/accountscheck/accountscheck.pro
......@@ -29,7 +29,7 @@ Start messageserver only after all accounts related services. Contributes JB#286
diff --git a/src/tools/accountscheck/accountscheck.cpp b/src/tools/accountscheck/accountscheck.cpp
new file mode 100644
index 00000000..364fb77e
index 0000000..364fb77
--- /dev/null
+++ b/src/tools/accountscheck/accountscheck.cpp
@@ -0,0 +1,63 @@
......@@ -98,7 +98,7 @@ index 00000000..364fb77e
+}
diff --git a/src/tools/accountscheck/accountscheck.pro b/src/tools/accountscheck/accountscheck.pro
new file mode 100644
index 00000000..0c707b92
index 0000000..0c707b9
--- /dev/null
+++ b/src/tools/accountscheck/accountscheck.pro
@@ -0,0 +1,19 @@
......@@ -123,7 +123,7 @@ index 00000000..0c707b92
+INSTALLS+= target systemd
diff --git a/src/tools/systemd/messageserver5-accounts-check.service b/src/tools/systemd/messageserver5-accounts-check.service
new file mode 100644
index 00000000..c2ec29ea
index 0000000..c2ec29e
--- /dev/null
+++ b/src/tools/systemd/messageserver5-accounts-check.service
@@ -0,0 +1,12 @@
......@@ -141,7 +141,7 @@ index 00000000..c2ec29ea
+WantedBy=user-session.target
diff --git a/src/tools/systemd/messageserver5.service b/src/tools/systemd/messageserver5.service
new file mode 100644
index 00000000..0d583d15
index 0000000..0d583d1
--- /dev/null
+++ b/src/tools/systemd/messageserver5.service
@@ -0,0 +1,15 @@
......@@ -161,7 +161,7 @@ index 00000000..0d583d15
+[Install]
+WantedBy=user-session.target
diff --git a/src/tools/tools.pro b/src/tools/tools.pro
index d05c3377..689ad320 100644
index d05c337..689ad32 100644
--- a/src/tools/tools.pro
+++ b/src/tools/tools.pro
@@ -1,2 +1,6 @@
......@@ -172,5 +172,5 @@ index d05c3377..689ad320 100644
+ SUBDIRS += accountscheck
+}
--
2.17.2
1.8.3-rc3
From 403bfc07c452c18690e5d8228f16fea3f0f84fbd Mon Sep 17 00:00:00 2001
From 11f08173dc746f86d94e8352a8f32dc3d1e44053 Mon Sep 17 00:00:00 2001
From: Valerio Valerio <valerio.valerio@jollamobile.com>
Date: Wed, 10 Sep 2014 14:36:13 +0300
Subject: [PATCH 06/17] Add keepalive timer to IMAP IDLE service
......@@ -6,12 +6,10 @@ Subject: [PATCH 06/17] Add keepalive timer to IMAP IDLE service
This commit introduce a dependency on nemo-keepalive via
DEFINES+=USE_KEEPALIVE
---
src/plugins/messageservices/imap/imap.pro | 4 ++
src/plugins/messageservices/imap/imapclient.cpp | 3 ++
src/plugins/messageservices/imap/imapclient.h | 6 +++
src/plugins/messageservices/imap/imapservice.cpp | 49 ++++++++++++++++++++++++
src/plugins/messageservices/imap/imapservice.h | 9 ++++-
5 files changed, 70 insertions(+), 1 deletion(-)
src/plugins/messageservices/imap/imap.pro | 4 ++++
src/plugins/messageservices/imap/imapservice.cpp | 23 +++++++++++++++++++++++
src/plugins/messageservices/imap/imapservice.h | 11 +++++++++++
3 files changed, 38 insertions(+)
diff --git a/src/plugins/messageservices/imap/imap.pro b/src/plugins/messageservices/imap/imap.pro
index 1c0ae6b..1b5742b 100644
......@@ -29,10 +27,10 @@ index 1c0ae6b..1b5742b 100644
QT += alignedtimer
}
diff --git a/src/plugins/messageservices/imap/imapservice.cpp b/src/plugins/messageservices/imap/imapservice.cpp
index e926f1c..392aee1 100644
index f132dd0..7cc0085 100644
--- a/src/plugins/messageservices/imap/imapservice.cpp
+++ b/src/plugins/messageservices/imap/imapservice.cpp
@@ -1517,6 +1517,12 @@ ImapService::ImapService(const QMailAccountId &accountId)
@@ -1518,6 +1518,12 @@ ImapService::ImapService(const QMailAccountId &accountId)
_networkSession(0),
_networkSessionTimer(new QTimer(this))
{
......@@ -45,15 +43,15 @@ index e926f1c..392aee1 100644
QMailAccount account(accountId);
if (!(account.status() & QMailAccount::CanSearchOnServer)) {
account.setStatus(QMailAccount::CanSearchOnServer, true);
@@ -1978,8 +2014,25 @@ void ImapService::setPersistentConnectionStatus(bool status)
@@ -1968,7 +1974,24 @@ void ImapService::setPersistentConnectionStatus(bool status)
}
}
_idling = status;
+#ifdef USE_KEEPALIVE
+ startStopBackgroundActivity();
+#endif
}
+}
+
+#ifdef USE_KEEPALIVE
+void ImapService::startStopBackgroundActivity()
+{
......@@ -65,28 +63,27 @@ index e926f1c..392aee1 100644
+ qMailLog(Messaging) << Q_FUNC_INFO << "Stopping keepalive";
+ _backgroundActivity->stop();
+ }
+}
}
+#endif
+
class ImapConfigurator : public QMailMessageServiceConfigurator
{
public:
diff --git a/src/plugins/messageservices/imap/imapservice.h b/src/plugins/messageservices/imap/imapservice.h
index c9d38fe..21797de 100644
index 00682a8..b3e8dd9 100644
--- a/src/plugins/messageservices/imap/imapservice.h
+++ b/src/plugins/messageservices/imap/imapservice.h
@@ -51,6 +51,10 @@
#include "imapclient.h"
@@ -38,6 +38,10 @@
#include <qmailmessageservice.h>
#include <QNetworkSession>
+
+#ifdef USE_KEEPALIVE
+#include <keepalive/backgroundactivity.h>
+#endif
+
QT_BEGIN_NAMESPACE
@@ -71,6 +71,10 @@ protected slots:
class QNetworkConfigurationManager;
@@ -83,6 +87,10 @@ protected slots:
void openIdleSession();
void closeIdleSession();
......@@ -97,7 +94,7 @@ index c9d38fe..21797de 100644
private slots:
void onOnlineStateChanged(bool isOnline);
void onSessionOpened();
@@ -110,6 +114,9 @@ private:
@@ -114,6 +122,9 @@ private:
QNetworkConfigurationManager *_networkConfigManager; // Qt network configuration manager
QNetworkSession *_networkSession; // Qt network session
QTimer *_networkSessionTimer;
......@@ -108,5 +105,5 @@ index c9d38fe..21797de 100644
class ImapServicePlugin : public QMailMessageServicePlugin
--
2.7.4
1.8.3-rc3
From a6fa0b03ba4bc51c0338f7a31f0b8ba316376b7a Mon Sep 17 00:00:00 2001
From 3daf24239f43d5c5ab28a29f70287851e54d8f5c Mon Sep 17 00:00:00 2001
From: Valerio Valerio <valerio.valerio@jollamobile.com>
Date: Mon, 27 Oct 2014 09:49:12 +0200
Subject: [PATCH 07/19] Use Qt5 booster to save memory.
Subject: [PATCH 07/17] Use Qt5 booster to save memory.
---
src/tools/messageserver/main.cpp | 2 +-
......@@ -10,7 +10,7 @@ Subject: [PATCH 07/19] Use Qt5 booster to save memory.
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/tools/messageserver/main.cpp b/src/tools/messageserver/main.cpp
index 9c107629..d9a35c53 100644
index 9c10762..d9a35c5 100644
--- a/src/tools/messageserver/main.cpp
+++ b/src/tools/messageserver/main.cpp
@@ -41,7 +41,7 @@
......@@ -23,7 +23,7 @@ index 9c107629..d9a35c53 100644
#ifdef USE_HTML_PARSER
// Need for html parsing by <QTextdocument> in qmailmessage.cpp, but don't need real UI
diff --git a/src/tools/messageserver/messageserver.pro b/src/tools/messageserver/messageserver.pro
index f7d92931..a092b8ce 100644
index f7d9293..a092b8c 100644
--- a/src/tools/messageserver/messageserver.pro
+++ b/src/tools/messageserver/messageserver.pro
@@ -17,6 +17,12 @@ contains(DEFINES, USE_HTML_PARSER) {
......@@ -40,7 +40,7 @@ index f7d92931..a092b8ce 100644
target.path += $$QMF_INSTALL_ROOT/bin
diff --git a/src/tools/systemd/messageserver5.service b/src/tools/systemd/messageserver5.service
index 0d583d15..a5aa05a9 100644
index 0d583d1..a5aa05a 100644
--- a/src/tools/systemd/messageserver5.service
+++ b/src/tools/systemd/messageserver5.service
@@ -1,13 +1,13 @@
......@@ -61,5 +61,5 @@ index 0d583d15..a5aa05a9 100644
RestartSec=1
--
2.17.2
1.8.3-rc3
From 4749c990bb8892333c0e713718e3e34cb47874fc Mon Sep 17 00:00:00 2001
From 3b543f7c23c2906669d1041419a2e8094c8c8ea3 Mon Sep 17 00:00:00 2001
From: Pekka Vuorela <pekka.vuorela@jolla.com>
Date: Mon, 13 Aug 2018 17:24:36 +0300
Subject: [PATCH 08/17] Introduce QMailAccount::HasPersistentConnection status
......@@ -60,5 +60,5 @@ index f352b1d..599b573 100644
ssoAccount->setValue("emailaddress", account->fromAddress().address());
ssoAccount->setValue("fullName", account->fromAddress().name());
--
2.7.4
1.8.3-rc3
From f4fbc8ea0bc2e1c3b5dff51ea1649df1f6926393 Mon Sep 17 00:00:00 2001
From c63f681dd192b2bbf8d3cd28b77170a837f3e7bc Mon Sep 17 00:00:00 2001
From: Valerio Valerio <valerio.valerio@jollamobile.com>
Date: Wed, 17 Dec 2014 17:16:45 +0000
Subject: [PATCH 10/19] Handle SMTP response 504.
Subject: [PATCH 10/17] Handle SMTP response 504.
Handle SMTP response 504 and reset auth method if auth from caps is
enabled.
---
src/libraries/qmfclient/ssosessionmanager.cpp | 2 +-
.../qmfmessageserver/qmailauthenticator.cpp | 2 +-
.../qmfmessageserver/qmailauthenticator.h | 2 +-
.../imap/imapauthenticator.cpp | 50 +++++++++----------
.../smtp/smtpauthenticator.cpp | 49 +++++++++---------
.../messageservices/smtp/smtpclient.cpp | 28 +++++++++--
src/plugins/messageservices/smtp/smtpclient.h | 1 +
src/libraries/qmfclient/ssosessionmanager.cpp | 2 +-
.../qmfmessageserver/qmailauthenticator.cpp | 2 +-
.../qmfmessageserver/qmailauthenticator.h | 2 +-
.../messageservices/imap/imapauthenticator.cpp | 50 +++++++++++-----------
.../messageservices/smtp/smtpauthenticator.cpp | 49 +++++++++++----------
src/plugins/messageservices/smtp/smtpclient.cpp | 28 ++++++++++--
src/plugins/messageservices/smtp/smtpclient.h | 1 +
7 files changed, 77 insertions(+), 57 deletions(-)
diff --git a/src/libraries/qmfclient/ssosessionmanager.cpp b/src/libraries/qmfclient/ssosessionmanager.cpp
index edb467d1..dd469aec 100644
index edb467d..dd469ae 100644
--- a/src/libraries/qmfclient/ssosessionmanager.cpp
+++ b/src/libraries/qmfclient/ssosessionmanager.cpp
@@ -113,7 +113,7 @@ void SSOSessionManager::cancel()
......@@ -29,7 +29,7 @@ index edb467d1..dd469aec 100644
Returns true if the account has one email service enabled and a valid identity stored
in ths accounts-sso database, otherwise returns false.
diff --git a/src/libraries/qmfmessageserver/qmailauthenticator.cpp b/src/libraries/qmfmessageserver/qmailauthenticator.cpp
index 373bcf21..0827ab58 100644
index 373bcf2..0827ab5 100644
--- a/src/libraries/qmfmessageserver/qmailauthenticator.cpp
+++ b/src/libraries/qmfmessageserver/qmailauthenticator.cpp
@@ -131,7 +131,7 @@ QByteArray QMailAuthenticator::getAuthentication(const QMailAccountConfiguration
......@@ -42,7 +42,7 @@ index 373bcf21..0827ab58 100644
QMailServiceConfiguration configuration(svcCfg);
if (!configuration.value("smtpusername").isEmpty() && authType == QMail::CramMd5Mechanism) {
diff --git a/src/libraries/qmfmessageserver/qmailauthenticator.h b/src/libraries/qmfmessageserver/qmailauthenticator.h
index 3891139d..04ded033 100644
index 3891139..04ded03 100644
--- a/src/libraries/qmfmessageserver/qmailauthenticator.h
+++ b/src/libraries/qmfmessageserver/qmailauthenticator.h
@@ -46,7 +46,7 @@ public:
......@@ -55,7 +55,7 @@ index 3891139d..04ded033 100644
static QByteArray getResponse(const QMailAccountConfiguration::ServiceConfiguration &svcCfg, const QByteArray &challenge);
#endif
diff --git a/src/plugins/messageservices/imap/imapauthenticator.cpp b/src/plugins/messageservices/imap/imapauthenticator.cpp
index 38dd4d9f..46de9f49 100644
index 38dd4d9..46de9f4 100644
--- a/src/plugins/messageservices/imap/imapauthenticator.cpp
+++ b/src/plugins/messageservices/imap/imapauthenticator.cpp
@@ -109,6 +109,25 @@ static QMail::SaslMechanism authFromCapabilities(const QStringList &capabilities
......@@ -139,7 +139,7 @@ index 38dd4d9f..46de9f49 100644
}
} else {
diff --git a/src/plugins/messageservices/smtp/smtpauthenticator.cpp b/src/plugins/messageservices/smtp/smtpauthenticator.cpp
index 8e57a76f..100bdc27 100644
index 8e57a76..100bdc2 100644
--- a/src/plugins/messageservices/smtp/smtpauthenticator.cpp
+++ b/src/plugins/messageservices/smtp/smtpauthenticator.cpp
@@ -76,6 +76,25 @@ static SmtpConfiguration::AuthType authFromCapabilities(const QStringList &capab
......@@ -222,7 +222,7 @@ index 8e57a76f..100bdc27 100644
}
} else {
diff --git a/src/plugins/messageservices/smtp/smtpclient.cpp b/src/plugins/messageservices/smtp/smtpclient.cpp
index 3b87e6ef..b15bf40d 100644
index ba0d5cf..9d8dfbd 100644
--- a/src/plugins/messageservices/smtp/smtpclient.cpp
+++ b/src/plugins/messageservices/smtp/smtpclient.cpp
@@ -112,6 +112,7 @@ SmtpClient::SmtpClient(QObject* parent)
......@@ -276,7 +276,7 @@ index 3b87e6ef..b15bf40d 100644
} else {
#ifdef USE_ACCOUNTS_QT
diff --git a/src/plugins/messageservices/smtp/smtpclient.h b/src/plugins/messageservices/smtp/smtpclient.h
index 1ca218a8..96852b2b 100644
index 1ca218a..96852b2 100644
--- a/src/plugins/messageservices/smtp/smtpclient.h
+++ b/src/plugins/messageservices/smtp/smtpclient.h
@@ -167,6 +167,7 @@ private:
......@@ -288,5 +288,5 @@ index 1ca218a8..96852b2b 100644
QTimer *authTimeout;
--
2.17.2
1.8.3-rc3
From bca2db1fc2a8743e1206112e39a100f7318a998d Mon Sep 17 00:00:00 2001
From e0b72aea5aa65d271973b33810e8099151fcfd14 Mon Sep 17 00:00:00 2001
From: Valerio Valerio <valerio.valerio@jollamobile.com>
Date: Mon, 19 Jan 2015 11:25:01 +0200
Subject: [PATCH 11/19] Recreate SSO identity for smtp in case of failure.
Subject: [PATCH 11/17] Recreate SSO identity for smtp in case of failure.
Similar to what is already done for IMAP.
---
......@@ -10,7 +10,7 @@ Similar to what is already done for IMAP.
2 files changed, 12 insertions(+)
diff --git a/src/plugins/messageservices/smtp/smtpclient.cpp b/src/plugins/messageservices/smtp/smtpclient.cpp
index b15bf40d..38de0874 100644
index 9d8dfbd..19f6988 100644
--- a/src/plugins/messageservices/smtp/smtpclient.cpp
+++ b/src/plugins/messageservices/smtp/smtpclient.cpp
@@ -118,6 +118,8 @@ SmtpClient::SmtpClient(QObject* parent)
......@@ -52,7 +52,7 @@ index b15bf40d..38de0874 100644
operationFailed(QMailServiceAction::Status::ErrLoginFailed, error);
}
diff --git a/src/plugins/messageservices/smtp/smtpclient.h b/src/plugins/messageservices/smtp/smtpclient.h
index 96852b2b..12003c7e 100644
index 96852b2..12003c7 100644
--- a/src/plugins/messageservices/smtp/smtpclient.h
+++ b/src/plugins/messageservices/smtp/smtpclient.h
@@ -175,6 +175,8 @@ private:
......@@ -65,5 +65,5 @@ index 96852b2b..12003c7e 100644
#endif
};
--
2.17.2
1.8.3-rc3
From af3a3808ec7a9c527de75edc5e3ac52f54fb9495 Mon Sep 17 00:00:00 2001
From 4a87f431dc1c8f4a99a7b767fc450f7255a6baab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Val=C3=A9rio=20Val=C3=A9rio?= <valerio.valerio@jolla.com>
Date: Fri, 20 Feb 2015 15:06:21 +0200
Subject: [PATCH 16/19] Do AUTHENTICATE PLAIN in two stages
Subject: [PATCH 13/17] Do AUTHENTICATE PLAIN in two stages
Some servers(e.g yandex.ru) do not support AUTHENTICATE PLAIN in a
single command, according to RFC4616 this way is optional, so we allways
perform the authentication in two stages that is gurantee to be supported
by all implementations of the protocol.
---
.../imap/imapauthenticator.cpp | 11 +++++++---
.../ssoauth/password/passwordplugin.cpp | 20 ++++++++++---------
.../messageservices/imap/imapauthenticator.cpp | 11 ++++++++---
src/plugins/ssoauth/password/passwordplugin.cpp | 20 +++++++++++---------
2 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/src/plugins/messageservices/imap/imapauthenticator.cpp b/src/plugins/messageservices/imap/imapauthenticator.cpp
index 46de9f49..97d94764 100644
index 46de9f4..97d9476 100644
--- a/src/plugins/messageservices/imap/imapauthenticator.cpp
+++ b/src/plugins/messageservices/imap/imapauthenticator.cpp
@@ -44,11 +44,11 @@
......@@ -53,7 +53,7 @@ index 46de9f49..97d94764 100644
return QMailAuthenticator::getResponse(svcCfg, challenge);
#endif
diff --git a/src/plugins/ssoauth/password/passwordplugin.cpp b/src/plugins/ssoauth/password/passwordplugin.cpp
index 20d2cf57..279f9721 100644
index 20d2cf5..279f972 100644
--- a/src/plugins/ssoauth/password/passwordplugin.cpp
+++ b/src/plugins/ssoauth/password/passwordplugin.cpp
@@ -94,20 +94,22 @@ QMap<QString, QList<QByteArray> > SSOPasswordPlugin::getIMAPAuthentication(const
......@@ -98,5 +98,5 @@ index 20d2cf57..279f9721 100644
// Currently pop account does not have any auth settings, so only plain can be used
--
2.17.2
1.8.3-rc3
From 0b5710503a9e7e14daf76331b09faedf137cea95 Mon Sep 17 00:00:00 2001
From 2f315e17d074d9a73c010b77958b22638fb412a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Val=C3=A9rio=20Val=C3=A9rio?= <valerio.valerio@jolla.com>
Date: Mon, 23 Feb 2015 13:31:30 +0200
Subject: [PATCH 17/19] Prevent push enabled status to go out of sync.
Subject: [PATCH 14/17] Prevent push enabled status to go out of sync.
---
.../messageservices/imap/imapservice.cpp | 57 +++++++++++--------
src/plugins/messageservices/imap/imapservice.cpp | 57 ++++++++++++++----------
1 file changed, 33 insertions(+), 24 deletions(-)
diff --git a/src/plugins/messageservices/imap/imapservice.cpp b/src/plugins/messageservices/imap/imapservice.cpp
index 5c8312c6..bac7c567 100644
index 157da85..c8300aa 100644
--- a/src/plugins/messageservices/imap/imapservice.cpp
+++ b/src/plugins/messageservices/imap/imapservice.cpp
@@ -64,7 +64,10 @@ QString connectionSettings(ImapConfiguration &config)
@@ -65,7 +65,10 @@ QString connectionSettings(ImapConfiguration &config)
result << config.mailServer();
result << QString::number(config.mailPort());
result << QString::number(config.mailEncryption());
......@@ -22,7 +22,7 @@ index 5c8312c6..bac7c567 100644
return result.join(QChar('\x0A')); // 0x0A is not a valid character in any connection setting
}
@@ -1523,6 +1526,11 @@ ImapService::ImapService(const QMailAccountId &accountId)
@@ -1524,6 +1527,11 @@ ImapService::ImapService(const QMailAccountId &accountId)
_networkSession(0),
_networkSessionTimer(new QTimer(this))
{
......@@ -34,7 +34,7 @@ index 5c8312c6..bac7c567 100644
QMailAccount account(accountId);
if (!(account.status() & QMailAccount::CanSearchOnServer)) {
account.setStatus(QMailAccount::CanSearchOnServer, true);
@@ -1545,8 +1553,6 @@ ImapService::ImapService(const QMailAccountId &accountId)
@@ -1546,8 +1554,6 @@ ImapService::ImapService(const QMailAccountId &accountId)
// Connect to dbus signals emitted by buteo notifying schedule changes
QDBusConnection m_dBusConnection(QDBusConnection::sessionBus());
......@@ -43,7 +43,7 @@ index 5c8312c6..bac7c567 100644
if(!m_dBusConnection.isConnected()) {
qWarning() << Q_FUNC_INFO << "Cannot connect to Dbus";
@@ -1576,22 +1582,19 @@ void ImapService::enable()
@@ -1577,22 +1583,19 @@ void ImapService::enable()
ImapConfiguration imapCfg(accountCfg);
bool pushEnabled = accountPushEnabled();
#ifdef USE_KEEPALIVE
......@@ -69,7 +69,7 @@ index 5c8312c6..bac7c567 100644
_previousPushFolders = imapCfg.pushFolders();
_previousConnectionSettings = connectionSettings(imapCfg);
@@ -1658,6 +1661,7 @@ void ImapService::accountsUpdated(const QMailAccountIdList &ids)
@@ -1655,6 +1658,7 @@ void ImapService::accountsUpdated(const QMailAccountIdList &ids)
if (_client) {
loggingIn = _client->loggingIn();
}
......@@ -77,7 +77,7 @@ index 5c8312c6..bac7c567 100644
if (!isEnabled) {
if (_accountWasEnabled) {
// Account changed from enabled to disabled
@@ -1776,7 +1780,7 @@ void ImapService::initiatePushEmail()
@@ -1767,7 +1771,7 @@ void ImapService::initiatePushEmail()
#ifdef USE_KEEPALIVE
QMailAccountConfiguration accountCfg(_accountId);
ImapConfiguration imapCfg(accountCfg);
......@@ -86,7 +86,7 @@ index 5c8312c6..bac7c567 100644
_previousPushFolders = imapCfg.pushFolders();
#endif
QMailFolderIdList ids(_client->configurationIdleFolderIds());
@@ -2088,23 +2092,28 @@ void ImapService::pushEnabledStatus(uint accountId, const QString &profileType,