From 5ef044eab02e1e8429a05b45398566ad81124fb6 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 23 Jan 2018 14:24:30 +0100 Subject: Fixed imap tests Adding the mail to cyrus imap somehow broke with cyrus 3.0. We're now creating the mail instead, before trying to sync it. --- examples/imapresource/tests/imapserverproxytest.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'examples/imapresource/tests/imapserverproxytest.cpp') diff --git a/examples/imapresource/tests/imapserverproxytest.cpp b/examples/imapresource/tests/imapserverproxytest.cpp index 999665f..f524d51 100644 --- a/examples/imapresource/tests/imapserverproxytest.cpp +++ b/examples/imapresource/tests/imapserverproxytest.cpp @@ -81,6 +81,25 @@ private slots: VERIFYEXEC_FAIL(imap.fetchFolders([](const Folder &){})); } + void testAppendMail() + { + ImapServerProxy imap("localhost", 143, Imap::EncryptionMode::NoEncryption); + VERIFYEXEC(imap.login("doe", "doe")); + + + auto mail = KMime::Message::Ptr::create(); + mail->from(true)->from7BitString(""); + mail->to(true)->from7BitString(""); + mail->subject(true)->from7BitString("subject"); + mail->setBody("Body"); + auto content = mail->encodedContent(true); + + KIMAP2::MessageFlags flags; + flags << Imap::Flags::Seen; + flags << Imap::Flags::Flagged; + VERIFYEXEC(imap.append("INBOX.test", content, flags, QDateTime::currentDateTimeUtc())); + } + void testFetchMail() { ImapServerProxy imap("localhost", 143, Imap::EncryptionMode::NoEncryption); -- cgit v1.2.3