Bug 345211 - mails in ~/.local/share/local-mail don't show up any more
Summary: mails in ~/.local/share/local-mail don't show up any more
Status: REPORTED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: Maildir Resource (show other bugs)
Version: 1.13.0
Platform: Ubuntu Linux
: NOR critical
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-16 11:35 UTC by m.eik michalke
Modified: 2020-04-27 10:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description m.eik michalke 2015-03-16 11:35:16 UTC
kmail (4.14.2) was bugging me for the past two days, stopped showing mails after a few folders were opened (saying i should wait while the folder was opened, but nothing was happening for an hour or so, i then closed the application). today, it totally quit working. i noticed that the folder structure in my local folders was completely gone (as seen in kmail -- there is actually ~3GB of mails in ~/.local/share/local-mail, the very folder that is configured).

i stopped akonadi, removed ~/.local/share/akonadi and restarted it to let it reconstruct the database, that created a new but empty ~/.local/share/.local-mail.directory, and the problem remains: no local mail folders in kmail. i examined the akonadi local maildir resource, it claims to be located at ~/.local/share/local-mail. i am confused. what can i try to get my mails showing up in kmail again?

Reproducible: Always

Steps to Reproduce:
i have no idea why this suddenly happened.

Actual Results:  
local mails are not shown, filters fail because target folders are missing. IMAP still seems to work.

Expected Results:  
list local mail folders like it did two days ago.
Comment 1 m.eik michalke 2015-03-16 20:12:11 UTC
1. i've noticed that two files are unusually large for my taste:
~/.config/akonadi/agent_config_akonadi_archivemail_agent_changes.dat 101K
~/.config/akonadi/agent_config_akonadi_migration_agent_changes.dat: 119K

2. adding a new maildir resource to akonadi pointing to ~/.local/share/local-mail doesn't change anything. the same is true for a full copy of the local folder to one named differently

3. removing ~/.local/share/.local-mail.directory and then starting akonadi again doesn't help: the hidden folder is regenerated again (it is missing on another machine with basically the same software running, no problems there)
Comment 2 m.eik michalke 2015-03-17 10:08:42 UTC
it gets worse: as it turns out, akonadi not only forgot about all my local mails, but also about all mailfilter rules' destinations (including all filters for IMAP and POP accounts), and all IMAP folder configurations.

i remember i got some weird "an error has occurred, unable to get lock" errors crashing kmail in the past, but only directly after logging into KDE and starting kmail for the first time. maybe that has something to do with it.

looks like i have to purge this akonadi geraffel totally and build it all up again from scratch. this will take days, at least (we're talking >110000 mails in 750 subfolders here).
Comment 3 m.eik michalke 2017-02-08 18:43:13 UTC
i just wanted to open a new bug ticket when i found this old one i opened almost two years ago.

so here we are again, but the other way around: i can see all my local mail in kmail (version 16.04.3), but ~/.local/share/local-mail itself is almost empty. when i create a new folder in kmail, it is also being created on disk in that folder. if i copy mails in kmail, they are written to that folder as single files. but if i move mails (not copying), kmail shows then in their new location, but nothing appears in the file system.

kmail says the local mail resource holds ~6GB of mails. i can browse the folders in kmail and open mails without problems. however, only a tiny fraction of those mails can be found in ~/.local/share/local-mail which is only ~200MB of size. where does kmail store my mails on disk? the have to be somewhere, right?

the symptoms are somehow similar to what i wrote two years ago, as today, kmail suddenly "forgot" all folder settings for one of my IMAP accounts, including all mail filter destination folders. and this happened on two different machines with the same IMAP account, while on both other IMAP accounts were not affected.
Comment 4 Peter Erdelyi 2017-03-13 20:07:52 UTC
I use Fedora 25 and have updated my system also on 27.02.2017. KMail, KMail-libs but also akonadi and pim packages were included. My subfolders have disappeared after the update. They are still stored in .local/share/local-mail folders, but can not be imported. Not as plaintext, not as archive file.
Comment 5 Peter Erdelyi 2017-03-13 20:29:38 UTC
Some of the updated packages and their versions:

kmail-16.12.2-1.fc25.x86_64
kf5-akonadi-server-16.12.2-1.fc25.x86_64
pim-storage-service-manager-16.12.2-1.fc25.x86_64
Comment 6 Igor Poboiko 2020-04-27 10:38:27 UTC
Git commit 4447e8894d4f3b4c08849956f33aa7156caa30a4 by Igor Poboiko.
Committed on 27/04/2020 at 10:38.
Pushed by poboiko into branch 'master'.

Save configuration when creating resources for new user

Summary:
Akonadi calls `writeConfig` DBus method to save the configuration for newly
created resources, both via `firstrun` and `SpecialCollections` mechanisms.
This method is non-existent for all of the resources (it was deprecated in
KConfig, and apparently is not exported to DBus), method `save` should
be used instead.

This is related to issues raised in {D27905}: settings provided in firstrun did
not override default settings for the resource.
Related: bug 352502

Test Plan:
1) Check `qdbus org.freedesktop.Akonadi.Resource.akonadi_maildir_resource_0 /Settings`
2) There is no `writeConfig` method, but there is `save` method

Reviewers: dvratil

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D28523

M  +1    -1    src/core/firstrun.cpp
M  +1    -1    src/core/jobs/specialcollectionshelperjobs.cpp

https://commits.kde.org/akonadi/4447e8894d4f3b4c08849956f33aa7156caa30a4
Comment 7 Igor Poboiko 2020-04-27 10:41:48 UTC
Git commit 1a13474c9a53e8b4b485a27189ff26f309f7fccb by Igor Poboiko.
Committed on 27/04/2020 at 10:41.
Pushed by poboiko into branch 'release/20.04'.

Save configuration when creating resources for new user

Summary:
Akonadi calls `writeConfig` DBus method to save the configuration for newly
created resources, both via `firstrun` and `SpecialCollections` mechanisms.
This method is non-existent for all of the resources (it was deprecated in
KConfig, and apparently is not exported to DBus), method `save` should
be used instead.

This is related to issues raised in {D27905}: settings provided in firstrun did
not override default settings for the resource.
Related: bug 352502

Test Plan:
1) Check `qdbus org.freedesktop.Akonadi.Resource.akonadi_maildir_resource_0 /Settings`
2) There is no `writeConfig` method, but there is `save` method

Reviewers: dvratil

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D28523

(cherry picked from commit 4447e8894d4f3b4c08849956f33aa7156caa30a4)

M  +1    -1    src/core/firstrun.cpp
M  +1    -1    src/core/jobs/specialcollectionshelperjobs.cpp

https://commits.kde.org/akonadi/1a13474c9a53e8b4b485a27189ff26f309f7fccb