Bug 263223

Summary: kmail doesnt show all mails in folder
Product: [Applications] kmail2 Reporter: Jim Jones <rauchwolke>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: major CC: bugs.m1, kollix, mcv, sven.burmeister, virtuousfox
Priority: NOR    
Version: 2.0.90   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:

Description Jim Jones 2011-01-15 14:25:05 UTC
Version:           2.0 beta1 (using KDE 4.5.95) 
OS:                Linux

when a new mail from a pop account is fetched it happens that a folder with ~1000 mails shows just the new mails when clicking on it - the only way to solve this, is to delete all new mails but sometimes it happens that when all new mails are deleted i dont see any mail at all and the folder seems to be empty ...

Reproducible: Always

Steps to Reproduce:
1) open kmail
2) fetch mails
3) go to the folder where the new mails are
4) folder with 1000 mails show just the new ones
Comment 1 S. Burmeister 2011-03-15 13:23:51 UTC
Same as bug 26412.
Comment 2 Michał 2011-07-31 16:04:02 UTC
I'm seeing similar bug, and I'm not sure if KMail lost all my emails or not. After fetching new mails and clicking inbox folder it's empty (and still there's (2) beside the folder name telling that there are two unread emails there).

Restarting KMail and KDE didn't help. I created a video which shows the problem:
http://mcv.mulabs.org/vid/kmail2-empty-folder-problem.mpeg
Comment 3 Michał 2011-07-31 16:11:10 UTC
I don't understand why do you thing this bug is the same as 26412.

Also, another (unrelated) thing: after posting my first comment I've been redirected to some completely unrelated KMail problem. It's not the first time this "bugzilla" behaves strangely.
Comment 4 S. Burmeister 2011-07-31 16:11:49 UTC
Taken from bug 264127

"Could you use the akonadiconsole to see if the second account has any items
with a remote id that is null?

(Tab db Console, query "select * from pimitemtable where remoteId = null")"

You can start akonadiconsole e.g. via ALT+F2, and check whether the folder has emails.

You can also quit kmail, issue akonadictl restart and then start kmail again. If you do akonadictl restart from a konsole you can see the output akonadi issues when you click on such an "empty" folder.
Comment 5 S. Burmeister 2011-07-31 16:12:07 UTC
264127 the 7 was missing
Comment 6 Michał 2011-07-31 16:19:35 UTC
I had empty result with "=", but when I changed it to "is null" it showed me 9 rows.
Comment 7 Michał 2011-07-31 16:26:41 UTC
I run akonadiconsole and got this output when clicking on the KMail folder:

posting retrieval request for item 63748  there are  1  queues and  0  items in mine 
processing retrieval request for item 63748  parts: ("ENVELOPE")  of resource: "akonadi_mixedmaildir_resource_1" 
request for item 63748 still pending - waiting 
akonadi_mixedmaildir_resource_1(29349)/akonadiresource (maildir): Failed to read item "{869a924c-06ab-4538-97df-bbd3cffb991b}" in Maildir "/home/mcv/Mail/inbox" 
akonadi_mixedmaildir_resource_1(29349)/akonadiresource (maildir): "Error while reading mails from folder " 
continuing 
request for item 63748 "{869a924c-06ab-4538-97df-bbd3cffb991b}" failed: "Resource was unable to deliver item" 
ItemRetrieverException :  Resource was unable to deliver item


Actually there is a file named like above (in ~/Mail/inbox/new), but it's only one byte long, hexedit shows: 0x0a.
Comment 8 S. Burmeister 2011-07-31 16:44:13 UTC
Yep, I found such a file as well. Removing it solves the issue. However the question is: How did this file get there. Where is its contents and why do I have to manually remove it/why does it hinder kmail to show the contents of the folder?
Comment 9 Michał 2011-07-31 17:26:53 UTC
I removed several other files containing only 1 byte, restarted akonadi, KMail and it worked. Thanks.
Comment 10 Sergey Kondakov 2011-08-03 05:54:15 UTC
uh, first day i managed to squeeze something other than 100% profanity-consisting sentences about KDEs user data storage habits nowadays and it immediately cut off access to my main email folder in kmail. the culprit was one stupid one-byte file too. ridiculous.

and of course there were nothing indicating that. only "103. unknown error" in kmail log and "error while reading emails from folder" from akonadi in tray. heh, not only it gives useless error messages but also accommodate them with made ups numbers now. it should have gone further and numbered it "0x0002067" or something like that.

thanks guys, without you i would have pulled all my hair out.
Comment 11 S. Burmeister 2011-08-03 06:45:27 UTC
Please make sure this report does not mix two different issues.

There is the issue of only showing _new_ emails: this bug report.

And then there is the issue of not showing _any_ emails at all. Different issue and due to the 1 byte files. (bug 279260)
Comment 12 Sergey Kondakov 2011-08-13 05:38:30 UTC
first of all, you filed that bug already after my post.

secondly, i'm not sure that this is really two issues.
today i've got a 1-byte filed in my mail folder for about 4rt time (so that mail folder would not show any mail) but in this time mail check was made and some new mail arrived. that new mail was shown alright.
this leds me to believe that only mail files, created after creation of screwed up 1-byre mail files, are readable thus only new mail is shown.

we should really attract devs attention to this one so that idiotic bug would be confirmed and fixed ASAP.
Comment 13 MK 2011-12-29 18:48:14 UTC
Hi!

I've got a similar problem with kmail2 in KDE 4.7.3:
Kmail doesn't show the content of any mail, but the list of mails above is available. I searched for those zero- and 1-byte-files but haven't found anything.

Akonadi-console shows one item with an empty remoteID (according to DB query; comment #4 by S.Burmeister)

Is this a new/different bug?
How do I remove the mail with empty remoteID from the database? Will this solve the problem?

Thanks!
Martin
Comment 14 Martin Koller 2013-02-09 21:16:16 UTC
Can not see this problem in KDE 4.10.
Is this still valid for you with this KDE version ?
Comment 15 Jim Jones 2013-10-24 20:45:33 UTC
no can be closed