[Kde-pim] Messages without body
Kevin Krammer
kevin.krammer at gmx.at
Thu Jul 29 19:36:37 BST 2010
Hi all,
while writing unit tests for item fetching from the MixedMaildir store, I've
discovered inconsistencies between MBox and Maildir regarding messages without
body.
The test data I am testing against has been created with KMail1, its the same
four messages for both MBox and Maildir.
I created all of them by sending new messages from one account to another,
For one of them I did not type anything into the main content area of the
composer.
When reading this message from Maildir, i.e. reading the raw data into a
bytearray and setting it on a KMime::Message using setContent(), the code that
checks for the body part (copied from the serializer plugin) detects a body
[1].
However, reading the same message from MBox does not.
(Message::body().isEmpty() == true)
When looking at the file, the difference seems to be that the Maildir file
ends in two empty lines, while the MBox file's entry only has one (followed by
the empty line which separates from the next entry).
I can of course check conditionally in the unittest, i.e. check whether the
lower level API would have a body and only then QVERIFY that the item has one.
But I first wanted to make sure it is not either a bug in libmaildir, libmbox
or KMime. [2]
Cheers,
Kevin
[1] it basically checks
if ( !msgPtr->body().isEmpty() || !msgPtr->contents().isEmpty() )
// has a body
second part is always false (contents is always empty) for all messages,
regardless of maildir/mbox
[2] A side effect of this is that such items, when retrieved from the Akonadi
resource, generate log output in Akonadi server, when it tries to retrieve
full payload but the resource is not delivering the body part.
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100729/45a6642c/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/
More information about the kde-pim
mailing list