Linux

Where Does KMail Store Mail and Accounts?

KMail keeps Local Folders mail in ~/.local/share/local-mail with cached accounts in the Akonadi store beside it.

Last updated

KMail never stores mail in one place. Local Folders live as maildir files under .local/share/local-mail. IMAP and cached account data live in the Akonadi store under .local/share/akonadi, backed by its own database. Settings live in kmail2rc wherever your distro puts KDE config.

Backups need the maildir tree first, since that holds messages no server will resend. Akonadi data second, for offline copies and search. Config last, for identities and transports. Resetting Akonadi fixes most corruption without touching a single message.

Where KMail stores this, by platform

Linux
~/.local/share/local-mail

Maildir tree with inbox, sent, drafts per folder. Akonadi cache and database sit in the sibling akonadi folder. Config file kmail2rc holds identities.

Frequently asked questions

How do I migrate KMail to a new machine?

Copy local-mail for messages plus the akonadi data dir and the akonadi configs. IMAP bodies re-download, but local folders and search indexes do not.

Akonadi is broken. How do I reset it without losing mail?

Stop Akonadi, delete ~/.local/share/akonadi and ~/.config/akonadi, then restart and re-add accounts. Keep resource configs if you want settings to refill themselves.

Where is the KMail settings file?

Run the kf config path lookup for kmail2rc to find the active file. Distros vary, so trust the tool output over any hardcoded config path.

Notice an outdated path? Let us know.