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 +++++++++++++++++++ examples/imapresource/tests/resetmailbox.sh | 4 ---- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'examples/imapresource') 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); diff --git a/examples/imapresource/tests/resetmailbox.sh b/examples/imapresource/tests/resetmailbox.sh index 8e6b1b1..b216ee4 100644 --- a/examples/imapresource/tests/resetmailbox.sh +++ b/examples/imapresource/tests/resetmailbox.sh @@ -9,7 +9,3 @@ sudo echo "subscribe INBOX.Drafts" | cyradm --auth PLAIN -u doe -w doe localhost sudo echo "cm user.doe.Trash" | cyradm --auth PLAIN -u cyrus -w admin localhost sudo echo "subscribe INBOX.Trash" | cyradm --auth PLAIN -u doe -w doe localhost sudo echo "sam user.doe cyrus c" | cyradm --auth PLAIN -u cyrus -w admin localhost -FOLDERPATH=/var/spool/imap/d/user/doe/test -sudo cp /src/sink/examples/imapresource/tests/data/1365777830.R28.localhost.localdomain\:2\,S $FOLDERPATH/1. -sudo chown cyrus:mail $FOLDERPATH/1. -sudo reconstruct "user.doe.test" -- cgit v1.2.3