Bug 281797 - kmail2/akonadi handels maildir incorrect
Summary: kmail2/akonadi handels maildir incorrect
Status: CONFIRMED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Maildir Resource (show other bugs)
Version: 5.3.1
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 303913 328025 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-11 12:22 UTC by Johannes Hirte
Modified: 2016-09-25 19:29 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
log file describing mail dir location and akonadi contents. (3.61 KB, text/plain)
2012-10-05 17:06 UTC, Dr. Christoph Pospiech
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Hirte 2011-09-11 12:22:27 UTC
Version:           unspecified (using KDE 4.7.1) 
OS:                Linux

Kmail2 with akonadi stores all maildir-mails in the new/ folder without info-suffix. Wheres kmail1 stored mails in the correct directory (cur/ when processed) named like "1309962120.21613.toOhv:2,S", kmail2 names them like "{fd227731-e306-4442-8815-cfed25d16f60}". Also the naming is unconventional, it is not wrong as long the mails are put in the right directory with the correct suffix.

Additional, when moving mails from an old kmaildir directory, some of them are marked as unread in the new maildir from kmail2. Also, when coping from a kmaildir, often only the headers where copied and the body was left empty. But I'm not sure, if this is related to the wrong naming/storing.

Reproducible: Always

Steps to Reproduce:
store mails in a local maildir
copy/move mails from an old kmaildir

Actual Results:  
mails are stored at wrong place/with wrong name
mails got copied incomplete and lose their read-state

Expected Results:  
mails should be stored in the correct maildir-way, don't lose their read-state and got copied complete
Comment 1 Thomas Zell 2011-11-08 17:37:17 UTC
Confirmed here (4.7.3), I guess this is purely an Akonadi issue.
Comment 2 Johannes Hirte 2011-11-14 16:39:16 UTC
The fixes that are gone into 4.7.3 aren't enough. The mails are now stored in the right directory but only if I mark them manually. Otherwise they're still stored in the new/ dircetory without the right suffix.
Comment 3 Thomas Zell 2011-12-04 13:37:34 UTC
Mails imported with kmailcvt always remain in the new/ folder, no matter if they are marked as read or not.
Comment 4 Johannes Hirte 2011-12-20 00:19:13 UTC
Still an issue with KDE SC 4.7.4. For example, I've fetched some mail via pop3. They were stored in the local inbox folder in the new/ directory. When reading them they were marked as read but stayed in the new/ direcotry. And this seems to be a problem. When I've tried to move them (in this case by marking them as spam manually), I got an error that this messages couldn't be moved. Marking them as unread and after this as read again, they were moved to the correct cur/ directory and now moving worked.

Kmail2 is really unusable with this behavior.
Comment 5 Johannes Hirte 2011-12-20 00:42:42 UTC
Surprisingly, with other filters it works. The mails that were moved by filters on fetch time into different folders are moved to the correct cur/ directory when I read them.
A second test with inbox also worked. The mail is moved into the cur/ directory when read. When marking it as spam, the mail is moved into the designated spam folder and there into the new/ directory, where it stays. Also moving them from the spam folder to trash puts them into the new/ directory there and not into cur/.
Comment 6 quazgar 2012-01-01 14:32:04 UTC
I don't know if it's the same bug, but for me, with 4.7.3 on Gentoo-64, importing from older Kmail directories did not create any files in the expected folders at all. I could verify with grep on a freshly created testuser, that the imported mails live _only_ inside the database (~/.local/share/akonadi/akonadi.db) and nowhere else on the file system.
Comment 7 Dr. Christoph Pospiech 2012-10-05 17:06:46 UTC
Created attachment 74363 [details]
log file describing mail dir location and akonadi contents.
Comment 8 Dr. Christoph Pospiech 2012-10-05 17:11:58 UTC
Comment on attachment 74363 [details]
log file describing mail dir location and akonadi contents.

This log file shows that kmail2 (kmail 4.8.5 on Kubuntu 12.04.1) places a mail in the "new" sub directory after a move from sent-mail to another local mail folder. The mail was in the "cur" sub directory before. The akonadi data base keeps the correct flags ( \SEEN). So - akonadi appears to be OK, but kmail2 is broken.
Comment 9 Dr. Christoph Pospiech 2012-10-05 17:27:42 UTC
BTW, as a work around, I wrote a perl script that renames the mail file and moves it from "new" to "cur", depending on the data stored in akonadi. To be on the safe side, you have to stop kmail and akonadi, but restart mysql to let the script run. Anyone interested please contact me. - Or should I place the script as an attachment to this bug report ?
Comment 10 Denis Kurz 2016-09-24 18:21:50 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 11 Marc Mezzarobba 2016-09-25 09:57:25 UTC
(In reply to Denis Kurz from comment #10)
> This bug has only been reported for versions before 4.14, which have been
> unsupported for at least two years now. Can anyone tell if this bug still
> present?

Something like this still happens to me with KMail 5.2.3: at least the majority of messages (both received and sent) moved from inbox to maildir folders appear to stay in the new/ directory. However, the names are correct afaict.

A few examples from yesterday:

$ ls -l --sort=time new/ | head -5
total 3520
-rw-r--r-- 1 marc marc   3642 sept. 24 20:29 1474741744.R502.tramontane:2,S
-rw-r--r-- 1 marc marc   1003 sept. 24 19:35 1474738555.R217.tramontane:2,S
-rw-r--r-- 1 marc marc   4891 sept. 24 17:57 1474732623.R961.tramontane:2,S
-rw-r--r-- 1 marc marc   3057 sept. 24 17:38 1474731481.R842.tramontane:2,S
Comment 12 Christophe Marin 2016-09-25 11:11:47 UTC
*** Bug 328025 has been marked as a duplicate of this bug. ***
Comment 13 Christophe Marin 2016-09-25 11:12:30 UTC
Thanks for the feedback.
Comment 14 Denis Kurz 2016-09-25 19:29:45 UTC
*** Bug 303913 has been marked as a duplicate of this bug. ***