Getting rid of either "Local Folders" or "KMail Folders"

Hi,
I’ve been using Kontact/KMail for quite some time (at least a decade) now and have updated it dozens of times. It’s been a while since a second set of local folders appeared (“KMail Folders”/“Local Folders”), so I don’t even remember which one was first. It hasn’t been bothersome enough for me to do something about it until now.

To me, it doesn’t matter which one to get rid of, but I’m fed up with the dual outbox/trash/sent folders, so I tried a simple “Delete Folder” from the context menu on “Local Folders.” This made KMail crash and not want to start again until I deleted the Local Folders agent in akonadiconsole. After restarting, both “Local Folders” were back in place, just as if I hadn’t even tried removing them.

So here’s my question:
Which of the two can be deleted without breaking KMail?
How to do that correctly?
(Do I have to delete it manually from the “collectiontable”?)

@twunder:

“Tools → Configure KMail → Accounts → Receiving”
More information is here – <Email Accounts – Receiving>


But, please be aware that, “Local Folders” is expected by the KMail code – it’s buried in the implementation …

You ought not modify or remove the Local Folders entry, which is present by default.

1 Like

It has been a long time since I’ve worked on this so my memory is a bit hazy :slight_smile:

“KMail Folders” is essentially an “import” of KMail’s original local folder structure if a system has been upgraded from such a version.

I have this as well, in fact so old that my original KMail mail folder is $HOME/Mail. I also have mixed maildir/mbox folders (I really should convert those mboxes at some point).

This alone should be fine so I am not entirely sure how you ended up with also having “Local Folders”.

In any case, the only thing that the system requires is that certain folders exist, e.g. “outbox” as otherwise it would not be able to send email at all.

Which “account” (technically Akonadi resource) is used for that is controlled via $HOME/.config/specialmailcollectionsrc

If that is empty or points to a resource that does not exist then the system will “heal” itself by starting a “local folders” handler.
This might have happened for you at some point and is also what is currently keeping you from deleting it (system just runs into its fallback again).

You have a couple of options:

  1. Continue with using “Local Folders”. You might want to check for any email in “KMail Folders” to copy over but you should be able to delete that other account/resource

  2. Make “KMail Folders” the default. In Akonadiconsole you see the resource identifier in the “Details” section at the bottom of the “Agents” tab. Using that value in the config file mentioned above should make these folders the default and allow you to remove “local folders”
    You should probably shut down all PIM applications and the Akonadi service itself (akonadictl stop) before making any changes to the config file mentioned above.

  3. As an alternative to (1) it might be possible to configure “Local Folders” such that it points to the same location as “KMail Folders” so you wouldn’t need to copy mails before deleting the latter. However this really depends on old your previous data is, e.g. in my case I would no longer have access to any of the mbox folders.

3 Likes