Commit ac360b3a authored by Sandro Knauß's avatar Sandro Knauß 🐝
Browse files

Decryption Oracle based on forwarding PGP or S/MIME mails (CVE-2019-10732)

Summary:
Add test coverage for mail forwarding.

BUG: 404698

Test Plan:
all tests passes
forward (text/html):
[x] PGP Mime text
[x] PGP Mime html
[x] S/MIME
[x] PGP inline

Reviewers: #kde_pim, vkrause, aacid, dfaure

Subscribers: kde-pim, security-team

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D20847
parent 8f9b85b6
Subject: Testcase 'reply-mix-crlf' (PGP/MIME HTML)
To: brucewayne45@web.de
From: brucewayne45@web.de
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BOUNDARY"
--BOUNDARY
Content-Type: text/plain
Please reply to this message
.
.
.
--BOUNDARY
Content-Type: text/plain; name="text1.txt"
Content-Disposition: inline
-----BEGIN PGP MESSAGE-----
hQEMAwzOQ1qnzNo7AQf7BxmM0vO8nG37hKqoqOHb35JqprJM+sqF7JFmrsuWe6V2
PAyyE2wdtq+AhvXjVnggxYLwU+DEFpBTmWr1rsanyV8hWXRbecfN/9gN/4/N9y7Z
XSx2OeE/uA5z8Kz5vrv/ywMqcVHjB5MQPTcLC2Zlg8MVltpriy6mdAkON4I3t7kl
j9uwQRY7HeKvsib63HWnYAOV/fYPXXor/lioeYIll08uuCiTh3Z9fEhXQI/az5Ft
e/xa70xGqviux+OvhoNUSZspzl7vK7e/NTBlC+LF1zVXUXT8prrd+ZFNwKvtn0Hl
W4KfNqTM9TJB8vpE5FWnH6+B365ZvxZopZ5F/9szp9JGAUCNdX5WujBreg7nTLui
UrnDNwOvjvsE/gsoO3n3jARK+Tu8PfUl8V1bHiCeGJz/mkA9uGJ/IApcT4rYsoHB
nVQjW1NJ6A==
=zrF/
-----END PGP MESSAGE-----
--BOUNDARY
Content-Type: text/plain; name="text2.txt"
Content-Disposition: inline
-----BEGIN PGP MESSAGE-----
hQEMAwzOQ1qnzNo7AQf+MCqjMjAB80hAMAHfa7bdk/6L4DJQBQn+zHRv6oYzzYFC
8l79DDIE2uorQNFj1ZBw5+pi7+/2QmAANnG2ug5W0HRphg2WPXTUswy5H+mg08PM
MXRsP9lX5pAXEbLZVp61tvOQHnO/ltBhHHBwRaIq2tiirUUhy5erqLwlkSyN8xHM
Bh0u/dIJw7ewMk0l3BtF/GuP7l6PtUxT7P0Vwit4h1FV1bc9mSFmBNN16dvixJ4l
jK0mYEqT97SNZpg0MPOxx8E3xuJptzea4qmACv5zx4gYHlZRM0ZlKNqffmRauWOe
pDCjZv2F1IUJOg28NzZhKCBVhmhBmP1VmLNYFKGAsNJHAV+3uN2YYWzbhoOJAE0N
UxLI0EQN4y7OkAnGiRH45HygLxAjTk6dPiP5OD9OhUnSqofAjajlmqzfAAVMxY1a
epnRKPsnCZU=
=dqBN
-----END PGP MESSAGE-----
--BOUNDARY
Content-Type: text/plain; name="text3.txt"
Content-Disposition: inline
-----BEGIN PGP MESSAGE-----
hQEMAwzOQ1qnzNo7AQf+MNDSEBVsF78knI+uirDbLSLrHicrXExTocmXr2DZOggI
zMYCAHyg7ohINA40/8ZuR0bC9h6qCZjjhR+VFe2edRFshXlbuzykjpXNYcSv61Sm
9TAVpgAExzS5VhAxYIJ6+zWJR8+hgv63oREZPWlJ23utBDAMkEeY7cga3wn1HZMZ
g4XQZ94a8s9s/I+s3dLOdHGdxw+hmSnxjMhI6TMcZV/Kvr1MkkW10N0h0+hiuq2O
4owEztpm4See8fCkRfhr0TO+a8ElCtIXjVwqeB0tQh0fU3QaaNiDXYawoFMQXG8N
nwCP92glfOeAvJn9KuLwO3ee+WKwcrJhsFRMmjziDdJGAUvptVDNrk2P/0fzo/Xl
ypmw8zhir6ch+4C2+5yFCtVSmC+3Y7+NQ4YE4AR/z5rGvA1lxclulU1DSGkhFTbJ
XEVyg8o23A==
=Bs3d
-----END PGP MESSAGE-----
--BOUNDARY
whoo three encrypted parts inside.
--BOUNDRY--
Subject: Testcase 'reply-mix-crlf' (PGP/MIME HTML)
To: brucewayne45@web.de
From: brucewayne45@web.de
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BOUNDARY"
--BOUNDARY
Content-Type: text/plain
Please reply to this message
.
.
.
--BOUNDARY
Content-Type: text/plain; name="text1.txt"
Content-Disposition: inline
-----BEGIN PGP MESSAGE-----
hQEMAwzOQ1qnzNo7AQf7BxmM0vO8nG37hKqoqOHb35JqprJM+sqF7JFmrsuWe6V2
PAyyE2wdtq+AhvXjVnggxYLwU+DEFpBTmWr1rsanyV8hWXRbecfN/9gN/4/N9y7Z
XSx2OeE/uA5z8Kz5vrv/ywMqcVHjB5MQPTcLC2Zlg8MVltpriy6mdAkON4I3t7kl
j9uwQRY7HeKvsib63HWnYAOV/fYPXXor/lioeYIll08uuCiTh3Z9fEhXQI/az5Ft
e/xa70xGqviux+OvhoNUSZspzl7vK7e/NTBlC+LF1zVXUXT8prrd+ZFNwKvtn0Hl
W4KfNqTM9TJB8vpE5FWnH6+B365ZvxZopZ5F/9szp9JGAUCNdX5WujBreg7nTLui
UrnDNwOvjvsE/gsoO3n3jARK+Tu8PfUl8V1bHiCeGJz/mkA9uGJ/IApcT4rYsoHB
nVQjW1NJ6A==
=zrF/
-----END PGP MESSAGE-----
--BOUNDARY
Content-Type: text/plain; name="text2.txt"
Content-Disposition: inline
-----BEGIN PGP MESSAGE-----
hQEMAwzOQ1qnzNo7AQf+MCqjMjAB80hAMAHfa7bdk/6L4DJQBQn+zHRv6oYzzYFC
8l79DDIE2uorQNFj1ZBw5+pi7+/2QmAANnG2ug5W0HRphg2WPXTUswy5H+mg08PM
MXRsP9lX5pAXEbLZVp61tvOQHnO/ltBhHHBwRaIq2tiirUUhy5erqLwlkSyN8xHM
Bh0u/dIJw7ewMk0l3BtF/GuP7l6PtUxT7P0Vwit4h1FV1bc9mSFmBNN16dvixJ4l
jK0mYEqT97SNZpg0MPOxx8E3xuJptzea4qmACv5zx4gYHlZRM0ZlKNqffmRauWOe
pDCjZv2F1IUJOg28NzZhKCBVhmhBmP1VmLNYFKGAsNJHAV+3uN2YYWzbhoOJAE0N
UxLI0EQN4y7OkAnGiRH45HygLxAjTk6dPiP5OD9OhUnSqofAjajlmqzfAAVMxY1a
epnRKPsnCZU=
=dqBN
-----END PGP MESSAGE-----
--BOUNDARY
Content-Type: text/plain; name="text3.txt"
Content-Disposition: inline
-----BEGIN PGP MESSAGE-----
hQEMAwzOQ1qnzNo7AQf+MNDSEBVsF78knI+uirDbLSLrHicrXExTocmXr2DZOggI
zMYCAHyg7ohINA40/8ZuR0bC9h6qCZjjhR+VFe2edRFshXlbuzykjpXNYcSv61Sm
9TAVpgAExzS5VhAxYIJ6+zWJR8+hgv63oREZPWlJ23utBDAMkEeY7cga3wn1HZMZ
g4XQZ94a8s9s/I+s3dLOdHGdxw+hmSnxjMhI6TMcZV/Kvr1MkkW10N0h0+hiuq2O
4owEztpm4See8fCkRfhr0TO+a8ElCtIXjVwqeB0tQh0fU3QaaNiDXYawoFMQXG8N
nwCP92glfOeAvJn9KuLwO3ee+WKwcrJhsFRMmjziDdJGAUvptVDNrk2P/0fzo/Xl
ypmw8zhir6ch+4C2+5yFCtVSmC+3Y7+NQ4YE4AR/z5rGvA1lxclulU1DSGkhFTbJ
XEVyg8o23A==
=Bs3d
-----END PGP MESSAGE-----
Please reply to this message<br>.<br>.<br>.<br><br>
Return-path: <sender@example.com>
Envelope-to: gunter@ohrner.net
Delivery-date: Mon, 12 Sep 2016 13:38:39 +0200
Received: from mail.from example.com ([178.251.88.150])
by luggage.ohrner.net with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256)
(Exim 4.80)
(envelope-from <sender@example.com>)
id 1bjPYi-0000oA-Re
for gunter@ohrner.net; Mon, 12 Sep 2016 13:38:39 +0200
Received: from example.com.local (172.17.124.205) by from example.com.local
(172.17.124.1) with Microsoft SMTP Server id 14.3.266.1; Mon, 12 Sep 2016
13:37:53 +0200
From: <sender@example.com>
To: <receiver@example.com>
Message-ID: <8614416.18.1473680273823.JavaMail.sender@example.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_16_9312243.1473680273820"
Date: Mon, 12 Sep 2016 13:37:53 +0200
X-TM-AS-Product-Ver: SMEX-11.1.0.1278-8.000.1202-22570.004
X-TM-AS-Result: No--23.664000-5.000000-31
X-TM-AS-User-Approved-Sender: No
X-TM-AS-User-Blocked-Sender: No
Subject: A Subject Line
------=_Part_16_9312243.1473680273820
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit
<html><head></head><body><p><span style="font-family:Arial;">A Body Text</span></p></body></html>
------=_Part_16_9312243.1473680273820
Content-Type: application/pdf; name="Attachment1.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
JVBERi0xLjEKJeLjz9MKMSAwIG9iaiAKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDIgMCBSCj4+
CmVuZG9iaiAKMiAwIG9iaiAKPDwKL0tpZHMgWzMgMCBSXQovVHlwZSAvUGFnZXMKL01lZGlhQm94
IFswIDAgMzAwIDE0NF0KL0NvdW50IDEKPj4KZW5kb2JqIAozIDAgb2JqIAo8PAovUmVzb3VyY2Vz
IAo8PAovRm9udCAKPDwKL0YxIAo8PAovU3VidHlwZSAvVHlwZTEKL1R5cGUgL0ZvbnQKL0Jhc2VG
b250IC9UaW1lcy1Sb21hbgo+Pgo+Pgo+PgovQ29udGVudHMgNCAwIFIKL1BhcmVudCAyIDAgUgov
VHlwZSAvUGFnZQovTWVkaWFCb3ggWzAgMCAzMDAgMTQ0XQo+PgplbmRvYmogCjQgMCBvYmogCjw8
Ci9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9MZW5ndGggNTIKPj4Kc3RyZWFtCnicU1BwCuFSAAJ9N0MF
QwuFkDQwzwAIQ1LATA2P1JycfIXw/KKcFE2FkCygoGsIACsbDAQKZW5kc3RyZWFtIAplbmRvYmog
eHJlZgowIDUKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAw
NjYgMDAwMDAgbiAKMDAwMDAwMDE0OSAwMDAwMCBuIAowMDAwMDAwMzMxIDAwMDAwIG4gCnRyYWls
ZXIKCjw8Ci9Sb290IDEgMCBSCi9TaXplIDUKPj4Kc3RhcnR4cmVmCjQ1NgolJUVPRgo=
------=_Part_16_9312243.1473680273820
Content-Type: application/pdf; name="Attachment2.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
JVBERi0xLjEKJeLjz9MKMSAwIG9iaiAKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDIgMCBSCj4+
CmVuZG9iaiAKMiAwIG9iaiAKPDwKL0tpZHMgWzMgMCBSXQovVHlwZSAvUGFnZXMKL01lZGlhQm94
IFswIDAgMzAwIDE0NF0KL0NvdW50IDEKPj4KZW5kb2JqIAozIDAgb2JqIAo8PAovUmVzb3VyY2Vz
IAo8PAovRm9udCAKPDwKL0YxIAo8PAovU3VidHlwZSAvVHlwZTEKL1R5cGUgL0ZvbnQKL0Jhc2VG
b250IC9UaW1lcy1Sb21hbgo+Pgo+Pgo+PgovQ29udGVudHMgNCAwIFIKL1BhcmVudCAyIDAgUgov
VHlwZSAvUGFnZQovTWVkaWFCb3ggWzAgMCAzMDAgMTQ0XQo+PgplbmRvYmogCjQgMCBvYmogCjw8
Ci9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9MZW5ndGggNTIKPj4Kc3RyZWFtCnicU1BwCuFSAAJ9N0MF
QwuFkDQwzwAIQ1LATA2P1JycfIXw/KKcFE2FkCygoGsIACsbDAQKZW5kc3RyZWFtIAplbmRvYmog
eHJlZgowIDUKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAw
NjYgMDAwMDAgbiAKMDAwMDAwMDE0OSAwMDAwMCBuIAowMDAwMDAwMzMxIDAwMDAwIG4gCnRyYWls
ZXIKCjw8Ci9Sb290IDEgMCBSCi9TaXplIDUKPj4Kc3RhcnR4cmVmCjQ1NgolJUVPRgo=
------=_Part_16_9312243.1473680273820
Content-Type: application/pdf; name="Attachment3.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
JVBERi0xLjEKJeLjz9MKMSAwIG9iaiAKPDwKL1R5cGUgL0NhdGFsb2cKL1BhZ2VzIDIgMCBSCj4+
CmVuZG9iaiAKMiAwIG9iaiAKPDwKL0tpZHMgWzMgMCBSXQovVHlwZSAvUGFnZXMKL01lZGlhQm94
IFswIDAgMzAwIDE0NF0KL0NvdW50IDEKPj4KZW5kb2JqIAozIDAgb2JqIAo8PAovUmVzb3VyY2Vz
IAo8PAovRm9udCAKPDwKL0YxIAo8PAovU3VidHlwZSAvVHlwZTEKL1R5cGUgL0ZvbnQKL0Jhc2VG
b250IC9UaW1lcy1Sb21hbgo+Pgo+Pgo+PgovQ29udGVudHMgNCAwIFIKL1BhcmVudCAyIDAgUgov
VHlwZSAvUGFnZQovTWVkaWFCb3ggWzAgMCAzMDAgMTQ0XQo+PgplbmRvYmogCjQgMCBvYmogCjw8
Ci9GaWx0ZXIgL0ZsYXRlRGVjb2RlCi9MZW5ndGggNTIKPj4Kc3RyZWFtCnicU1BwCuFSAAJ9N0MF
QwuFkDQwzwAIQ1LATA2P1JycfIXw/KKcFE2FkCygoGsIACsbDAQKZW5kc3RyZWFtIAplbmRvYmog
eHJlZgowIDUKMDAwMDAwMDAwMCA2NTUzNSBmIAowMDAwMDAwMDE1IDAwMDAwIG4gCjAwMDAwMDAw
NjYgMDAwMDAgbiAKMDAwMDAwMDE0OSAwMDAwMCBuIAowMDAwMDAwMzMxIDAwMDAwIG4gCnRyYWls
ZXIKCjw8Ci9Sb290IDEgMCBSCi9TaXplIDUKPj4Kc3RhcnR4cmVmCjQ1NgolJUVPRgo=
------=_Part_16_9312243.1473680273820--
From maillists@whattf.com Tue Jul 05 19:20:58 2011
Return-path: <maillists@whattf.com>
Envelope-to: maillists@whattf.com
Date: Mon, 24 Oct 2016 11:53:00 +0100
To: maillists@whattf.com
From: maillists@whattf.com
MIME-Version: 1.0
Subject: Test
Content-Type: multipart/related; boundary="----=_Part_20324_1054669183.1477306380301"
MIME-Version: 1.0
------=_Part_20324_1054669183.1477306380301
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 7bit
<html><head></head><body>HTML Text</body></html>
------=_Part_20324_1054669183.1477306380301
Content-Type: image/png
Content-Disposition: attachment; filename="image1.png"
Image1
------=_Part_20324_1054669183.1477306380301
Content-Type: image/png
Content-Disposition: attachment; filename="image2.png"
Image2
------=_Part_20324_1054669183.1477306380301--
......@@ -219,6 +219,168 @@ void TemplateParserJobTest::test_replyPlain()
QCOMPARE(convertedPlainTextContent, referenceData);
}
void TemplateParserJobTest::test_forwardPlain_data()
{
QTest::addColumn<QString>("mailFileName");
QTest::addColumn<QString>("referenceFileName");
QDir dir(QStringLiteral(MAIL_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
foreach (const QString &file, l) {
const QString expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".plain.reply");
if (!QFile::exists(expectedFile)) {
continue;
}
QTest::newRow(file.toLatin1().constData()) << QString(dir.path() + QLatin1Char('/') + file) << expectedFile;
}
}
void TemplateParserJobTest::test_forwardPlain()
{
QFETCH(QString, mailFileName);
QFETCH(QString, referenceFileName);
// load input mail
QFile mailFile(mailFileName);
QVERIFY(mailFile.open(QIODevice::ReadOnly));
const QByteArray mailData = KMime::CRLFtoLF(mailFile.readAll());
QVERIFY(!mailData.isEmpty());
KMime::Message::Ptr msg(new KMime::Message);
KMime::Message::Ptr origMsg(new KMime::Message);
origMsg->setContent(mailData);
origMsg->parse();
// load expected result
QFile referenceFile(referenceFileName);
QVERIFY(referenceFile.open(QIODevice::ReadOnly));
const QByteArray referenceRawData = KMime::CRLFtoLF(referenceFile.readAll());
const QString referenceData = QString::fromLatin1(referenceRawData);
QVERIFY(!referenceData.isEmpty());
TemplateParser::TemplateParserJob *parser = new TemplateParser::TemplateParserJob(msg, TemplateParser::TemplateParserJob::Forward);
parser->d->mOrigMsg = origMsg;
QSignalSpy spy(parser, &TemplateParser::TemplateParserJob::parsingDone);
parser->processWithTemplate(QString());
QVERIFY(spy.wait());
const QString convertedPlainTextContent = parser->plainMessageText(false, TemplateParser::TemplateParserJob::NoSelectionAllowed);
QCOMPARE(convertedPlainTextContent, referenceData);
}
void TemplateParserJobTest::test_forwardHtml_data()
{
QTest::addColumn<QString>("mailFileName");
QTest::addColumn<QString>("referenceFileName");
QDir dir(QStringLiteral(MAIL_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
foreach (const QString &file, l) {
const QString expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".html.reply");
if (!QFile::exists(expectedFile)) {
continue;
}
QTest::newRow(file.toLatin1().constData()) << QString(dir.path() + QLatin1Char('/') + file) << expectedFile;
}
}
void TemplateParserJobTest::test_forwardHtml()
{
QFETCH(QString, mailFileName);
QFETCH(QString, referenceFileName);
// load input mail
QFile mailFile(mailFileName);
QVERIFY(mailFile.open(QIODevice::ReadOnly));
const QByteArray mailData = KMime::CRLFtoLF(mailFile.readAll());
QVERIFY(!mailData.isEmpty());
KMime::Message::Ptr msg(new KMime::Message);
KMime::Message::Ptr origMsg(new KMime::Message);
origMsg->setContent(mailData);
origMsg->parse();
// load expected result
QFile referenceFile(referenceFileName);
QVERIFY(referenceFile.open(QIODevice::ReadOnly));
const QByteArray referenceRawData = KMime::CRLFtoLF(referenceFile.readAll());
const QString referenceData = QString::fromLatin1(referenceRawData);
QVERIFY(!referenceData.isEmpty());
TemplateParser::TemplateParserJob *parser = new TemplateParser::TemplateParserJob(msg, TemplateParser::TemplateParserJob::Forward);
parser->d->mOrigMsg = origMsg;
QSignalSpy spy(parser, &TemplateParser::TemplateParserJob::parsingDone);
parser->processWithTemplate(QString());
QVERIFY(spy.wait());
QString convertedHtmlContent = parser->htmlMessageText(false, TemplateParser::TemplateParserJob::NoSelectionAllowed);
// referenceData is read from a file and most text editors add a \n at the end of the last line
if (!convertedHtmlContent.endsWith(QStringLiteral("\n"))) {
convertedHtmlContent += QStringLiteral("\n");
}
QCOMPARE(convertedHtmlContent, referenceData);
}
void TemplateParserJobTest::test_forwardedAttachments_data()
{
QTest::addColumn<QString>("mailFileName");
QTest::addColumn<QString>("referenceFileName");
QDir dir(QStringLiteral(MAIL_DATA_DIR));
const auto l = dir.entryList(QStringList(QStringLiteral("*.mbox")), QDir::Files | QDir::Readable | QDir::NoSymLinks);
foreach (const QString &file, l) {
if (!QFile::exists(dir.path() + QLatin1Char('/') + file + QStringLiteral(".html.reply"))) {
continue;
}
QString expectedFile = dir.path() + QLatin1Char('/') + file + QStringLiteral(".forwarded.mbox");
QTest::newRow(file.toLatin1().constData()) << QString(dir.path() + QLatin1Char('/') + file) << expectedFile;
}
}
void TemplateParserJobTest::test_forwardedAttachments()
{
QFETCH(QString, mailFileName);
QFETCH(QString, referenceFileName);
// load input mail
QFile mailFile(mailFileName);
QVERIFY(mailFile.open(QIODevice::ReadOnly));
const QByteArray mailData = KMime::CRLFtoLF(mailFile.readAll());
QVERIFY(!mailData.isEmpty());
KMime::Message::Ptr msg(new KMime::Message);
KMime::Message::Ptr origMsg(new KMime::Message);
origMsg->setContent(mailData);
origMsg->parse();
bool referenceExists = QFile::exists(referenceFileName);
TemplateParser::TemplateParserJob *parser = new TemplateParser::TemplateParserJob(msg, TemplateParser::TemplateParserJob::Forward);
parser->d->mOrigMsg = origMsg;
QSignalSpy spy(parser, &TemplateParser::TemplateParserJob::parsingDone);
parser->processWithTemplate(QString());
QVERIFY(spy.wait());
if (referenceExists) {
QFile referenceFile(referenceFileName);
QVERIFY(referenceFile.open(QIODevice::ReadOnly));
const QByteArray referenceRawData = KMime::CRLFtoLF(referenceFile.readAll());
const KMime::Message::Ptr referenceMsg(new KMime::Message);
referenceMsg->setContent(referenceRawData);
referenceMsg->parse();
QCOMPARE(msg->contents().size(), referenceMsg->contents().size());
for (int i=1; i < msg->contents().size(); i++) {
QCOMPARE(msg->contents()[i]->encodedContent(), referenceMsg->contents()[i]->encodedContent());
}
} else {
QCOMPARE(msg->contents().size(), 0);
}
}
void TemplateParserJobTest::test_processWithTemplatesForBody_data()
{
QTest::addColumn<QString>("command");
......
......@@ -42,6 +42,15 @@ private Q_SLOTS:
void test_replyPlain();
void test_replyPlain_data();
void test_forwardPlain();
void test_forwardPlain_data();
void test_forwardHtml();
void test_forwardHtml_data();
void test_forwardedAttachments();
void test_forwardedAttachments_data();
/**
* Tests whether templates are returning required body or not
*/
......
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