This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to Archive Folder in kmail when when database is corrupt

Tags: None
(comma "," separated)
User avatar
xywa
Registered Member
Posts
48
Karma
0
OS
Hi,

My question is how to Archive Folder in kmail when when database is corrupted?
A i have such message when I am trying to archive one of the folders:
Failed to archive the folder 'xxx'. Downloading a message in folder 'xxx' failed.


At the moment, some of my emails are broken and has only headers (title, from, to) , but NO text inside message. When I run Akonadi Console and when I click on the same folder with messages as in kmail [Browser bookmark] I could see there is some missing ID [Model: Generic] - eg. I can see 11634, 11638, 11639 (so in this example there there are missing 35,36,37 - so those emails has only headers in kmail. Probably database is corrupted after migration from 4.9.5 into 4.10.0 couple of months ago.

So I decide to delete ALL configuration files and reinstall kontact/kmail again. The problem is - I cannot archive folders to do the fresh & virgin installation.

I use now 4.11.1 version from Gentoo.

How to fix it?
p.s. I cannot delete broken emails manually, as I have thousand of emails. Can Archive command just ignore broken files or it is possible to fix database?
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
Are you using POP, IMAP, or are the messages in the local folders?

In case of IMAP, everything will be re-synced when you wipe your configuration, so no possible issues. In case of local folders, they aren't touched (as long as you keep the path - .local/share/local-mail and .local/share/.local-mail.directory - untouched).


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
User avatar
xywa
Registered Member
Posts
48
Karma
0
OS
I keep (I think) those files locally.

But strange things - I have only .local/share/local-mail and inside there are few OLD folders I do not have anymore in kmail (I have deleted them few months ago), and this folder (with broken emails) is empty and it has NOT any sub-folders (but they exist in kmail).
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
Did you also check .local/share/.local-mail.directory?


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
User avatar
xywa
Registered Member
Posts
48
Karma
0
OS
Did you also check .local/share/.local-mail.directory?


I do only have .local/share/.local-mail - nothing else.
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
Check the configuration of your local folders to see where they point to.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
User avatar
xywa
Registered Member
Posts
48
Karma
0
OS
Check the configuration of your local folders to see where they point to.


What configuration do you mean?
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
You can see where the local folders are stored by going into Configure KMail > Accounts > Local Folders > Configure.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
User avatar
xywa
Registered Member
Posts
48
Karma
0
OS
You can see where the local folders are stored by going into Configure KMail > Accounts > Local Folders > Configure.


Thx for explanation. I've got this:
/home/me/.local/share/local-mail
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
And there, you don't find the messages you have there, correct?
Can you check with "ls -a" in .local/share to see if there are hidden folders?


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
User avatar
xywa
Registered Member
Posts
48
Karma
0
OS
You have some listings bellow. And you can see, there are some strange things here - it means folders and files in file-system in some places are different than in kmail.

First example bellow - listing of (.local-mail). As you can see (listing 1), there is .sent-mail.directory. I keep there (in kmail, in sent-mail folder) my all old emails form last years, every year in one folder - 2006, 2007, 2008... (listing 2). In listing 3 you can see whats inside 2006 folder, but all of subfolder of 2006 (cur, new, temp) are empty. Even du command says they are empty (see listing 4), but in compare du command for 2007 folder (see listing 5) says there is 53M of messages (instead of 4.3k for 2006). In reality, in kmail in sent-mail/2006 folder there are 504 emails! Even akonadi console says so (should be 8.5M of messages):
http://img837.imageshack.us/img837/3773/livu.jpg
So where are those emails in real file system if 2006 folder is empty?

I have some other examples like that - eg. I have a folder (in kmail) with 5 subfolder, and 100's other sub-sub-folder and over 1000's emails - but in file system (.inbox.directory) the same folder is empty, there is nothing appart empty (cur, new, temp) folders. Rest of system looks fine this just happed for few folder and few thousands emails. So this is reason I thinks there something wrong with data base.

Listing 1
Code: Select all
~/.local/share/local-mail $ ls -la
total 48
drwxr-xr-x 12 me me 4096 Apr  7 09:07 .
drwxr-xr-x 18 me me 4096 Sep 30 22:03 ..
drwxr-xr-x  5 me me 4096 Apr  7 09:07 drafts
drwxr-xr-x  5 me me 4096 Feb 11  2013 import
drwxr-xr-x  4 me me 4096 Feb 12  2013 .import.directory
drwxr-xr-x  5 me me 4096 Feb 10  2013 inbox
drwxr-xr-x 25 me me 4096 Sep 27 23:04 .inbox.directory
drwxr-xr-x  5 me me 4096 Feb 10  2013 outbox
drwxr-xr-x  5 me me 4096 Feb 10  2013 sent-mail
drwxr-xr-x 10 me me 4096 Feb 12  2013 .sent-mail.directory
drwxr-xr-x  5 me me 4096 Apr  7 09:07 templates
drwxr-xr-x  5 me me 4096 Apr  7 09:07 wastebin


Listing 2
Code: Select all
$ ls -la
total 40
drwxr-xr-x 10 me me 4096 Feb 12  2013 .
drwxr-xr-x 12 me me 4096 Apr  7 09:07 ..
drwxr-xr-x  5 me me 4096 Feb 12  2013 2006                                                                                                   
drwxr-xr-x  5 me me 4096 Feb 12  2013 2007
drwxr-xr-x  5 me me 4096 Feb 12  2013 2008
drwxr-xr-x  5 me me 4096 Feb 12  2013 2009
drwxr-xr-x  5 me me 4096 Feb 12  2013 2010
drwxr-xr-x  5 me me 4096 Feb 12  2013 2011
drwxr-xr-x  5 me me 4096 Feb 12  2013 2012
drwxr-xr-x  5 me me 4096 Feb 11  2013 2013


Listing 3
Code: Select all
~/.local/share/local-mail/.sent-mail.directory/2006 $ ls -la
total 20
drwxr-xr-x  5 me me 4096 Feb 12  2013 .
drwxr-xr-x 10 me me 4096 Feb 12  2013 ..
drwxr-xr-x  2 me me 4096 Feb 12  2013 cur
drwxr-xr-x  2 me me 4096 Feb 12  2013 new
drwxr-xr-x  2 me me 4096 Feb 12  2013 tmp


Listing 4
Code: Select all
~/.local/share/local-mail/.sent-mail.directory/2006 $ du --si
4.1k    ./cur
4.1k    ./tmp
4.1k    ./new
17k     .


Listing 5
Code: Select all
~/.local/share/local-mail/.sent-mail.directory/2007 $ du --si
4.1k    ./cur
4.1k    ./tmp
53M     ./new
53M     .
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
You can expect to find your messages in the cur/ or new/ directories (this is how the Maildir format works).


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
User avatar
xywa
Registered Member
Posts
48
Karma
0
OS
You can expect to find your messages in the cur/ or new/ directories (this is how the Maildir format works).


I know they should be there, but they aren't. Those directories are empty:

$ ls -la .local/share/local-mail/.sent-mail.directory/2006/cur/
total 8
drwxr-xr-x 2 me me 4096 Feb 12 2013 .
drwxr-xr-x 5 me me 4096 Feb 12 2013 ..


$ ls -la .local/share/local-mail/.sent-mail.directory/2006/new/
total 8
drwxr-xr-x 2 me me 4096 Feb 12 2013 .
drwxr-xr-x 5 me me 4096 Feb 12 2013 ..


ls -la .local/share/local-mail/.sent-mail.directory/2006/tmp/
total 8
drwxr-xr-x 2 me me 4096 Feb 12 2013 .
drwxr-xr-x 5 me me 4096 Feb 12 2013 ..


$ ls -la .local/share/local-mail/.sent-mail.directory/2006/
cur/ new/ tmp/
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
I'll try to bring the attention of a KDE PIM developer, as I'm not very knowledgeable with the internals.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
User avatar
xywa
Registered Member
Posts
48
Karma
0
OS
I'll try to bring the attention of a KDE PIM developer, as I'm not very knowledgeable with the internals.


Many thanks! ;D


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]