diff options
Diffstat (limited to 'examples/imapresource/tests/imapserverproxytest.cpp')
-rw-r--r-- | examples/imapresource/tests/imapserverproxytest.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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: | |||
81 | VERIFYEXEC_FAIL(imap.fetchFolders([](const Folder &){})); | 81 | VERIFYEXEC_FAIL(imap.fetchFolders([](const Folder &){})); |
82 | } | 82 | } |
83 | 83 | ||
84 | void testAppendMail() | ||
85 | { | ||
86 | ImapServerProxy imap("localhost", 143, Imap::EncryptionMode::NoEncryption); | ||
87 | VERIFYEXEC(imap.login("doe", "doe")); | ||
88 | |||
89 | |||
90 | auto mail = KMime::Message::Ptr::create(); | ||
91 | mail->from(true)->from7BitString("<doe@example.org>"); | ||
92 | mail->to(true)->from7BitString("<doe@example.org>"); | ||
93 | mail->subject(true)->from7BitString("subject"); | ||
94 | mail->setBody("Body"); | ||
95 | auto content = mail->encodedContent(true); | ||
96 | |||
97 | KIMAP2::MessageFlags flags; | ||
98 | flags << Imap::Flags::Seen; | ||
99 | flags << Imap::Flags::Flagged; | ||
100 | VERIFYEXEC(imap.append("INBOX.test", content, flags, QDateTime::currentDateTimeUtc())); | ||
101 | } | ||
102 | |||
84 | void testFetchMail() | 103 | void testFetchMail() |
85 | { | 104 | { |
86 | ImapServerProxy imap("localhost", 143, Imap::EncryptionMode::NoEncryption); | 105 | ImapServerProxy imap("localhost", 143, Imap::EncryptionMode::NoEncryption); |