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

akonadi confusion

Tags: None
(comma "," separated)
cpospiech
Registered Member
Posts
15
Karma
0
OS

akonadi confusion

Tue Feb 07, 2012 4:49 pm
Hi,

kmail2 mostly now works for me, but there are still a few strange issues which I don't understand. It may be that my akonadi is misconfigured. I would like to fix this, but I first need to understand how a correct configuration should look like.

In http://techbase.kde.org/Projects/PIM/Ak ... my_data.3F it is stated that "Akonadi merely acts as a cache for your data, the actual content stays where it has always been". Elsewhere I found a statement that ~/.local/share/akonadi/file_db_data merely acts as a cash.

Can anyone confirm that these statements still represent the state of direction ? Where should I locate the main storage for my mails then ?

I am asking because I got the impression that on my installation, there is no other mail storage than ~/.local/share/akonadi/file_db_data . At least there are no mails in the following place.
cp@sirius:~/.local/share$ find ~/.local/share/local-mail
/home/cp/.local/share/local-mail
/home/cp/.local/share/local-mail/tmp
/home/cp/.local/share/local-mail/new
/home/cp/.local/share/local-mail/cur

Can anyone confirm that my >19000 mails SHOULD be there (in maildir format) ? I don't use IMAP at all. It is all POP3 and fetchmail-like and mails are supposed to be stored locally.

Given that my above guesses are correct, the next question is of course how to move my installation into a legal state without loosing mail. Is there a tool for that ? Do I have to write a small C (or perl) utility restoring ~/.local/share/local-mail from that data base contents ?

Christoph Pospiech
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: akonadi confusion

Thu Feb 09, 2012 12:35 am
Look for ~/.local/share/.local-mail.directory/


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
cpospiech
Registered Member
Posts
15
Karma
0
OS

Re: akonadi confusion

Thu Feb 09, 2012 6:53 am
Hi, thanks for the hint. There are indeed a few mails, but not the bulk of the >19000 mails which have been moved from inbox and sent-mail to other local folders. These other local folders are shown by kmail2 on the same directory level as inbox, trash, sent-mail, but not in the file list below. Is this as it should be ?

cp@sirius:~$ find ~/.local/share/.local-mail.directory/
/home/cp/.local/share/.local-mail.directory/
/home/cp/.local/share/.local-mail.directory/.Old_Mail.directory
/home/cp/.local/share/.local-mail.directory/outbox
/home/cp/.local/share/.local-mail.directory/outbox/tmp
/home/cp/.local/share/.local-mail.directory/outbox/new
/home/cp/.local/share/.local-mail.directory/outbox/cur
/home/cp/.local/share/.local-mail.directory/templates
/home/cp/.local/share/.local-mail.directory/templates/tmp
/home/cp/.local/share/.local-mail.directory/templates/new
/home/cp/.local/share/.local-mail.directory/templates/cur
/home/cp/.local/share/.local-mail.directory/inbox
/home/cp/.local/share/.local-mail.directory/inbox/tmp
/home/cp/.local/share/.local-mail.directory/inbox/new
/home/cp/.local/share/.local-mail.directory/inbox/cur
/home/cp/.local/share/.local-mail.directory/inbox/cur/1328014264.R986.sirius:2,S
/home/cp/.local/share/.local-mail.directory/inbox/cur/1328201304.R925.sirius:2,S
/home/cp/.local/share/.local-mail.directory/inbox/cur/1325496019.R307.sirius:2,S
/home/cp/.local/share/.local-mail.directory/trash
/home/cp/.local/share/.local-mail.directory/trash/tmp
/home/cp/.local/share/.local-mail.directory/trash/new
/home/cp/.local/share/.local-mail.directory/trash/new/1328769552.R367.sirius
/home/cp/.local/share/.local-mail.directory/trash/cur
/home/cp/.local/share/.local-mail.directory/sent-mail
/home/cp/.local/share/.local-mail.directory/sent-mail/tmp
/home/cp/.local/share/.local-mail.directory/sent-mail/new
/home/cp/.local/share/.local-mail.directory/sent-mail/cur
/home/cp/.local/share/.local-mail.directory/sent-mail/cur/1328703725.R480.sirius:2,S
/home/cp/.local/share/.local-mail.directory/drafts
/home/cp/.local/share/.local-mail.directory/drafts/tmp
/home/cp/.local/share/.local-mail.directory/drafts/new
/home/cp/.local/share/.local-mail.directory/drafts/cur


Christoph Pospiech
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: akonadi confusion

Thu Feb 09, 2012 7:17 am
Can you check what location is specified for the Local Folders structure in KMail?
If it is not ~/.local/share/local-mail try checking that location instead (include the variation I showed).


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
cpospiech
Registered Member
Posts
15
Karma
0
OS

Re: akonadi confusion

Thu Feb 09, 2012 8:30 pm
The directory specified in kmail->Settings->Configure kmail->Accounts->Receiving->Local Folders is /home/cp/.local/share/local-mail. Is this the setting I should look for ? Or did you mean a different setting ?

Christoph Pospiech
cpospiech
Registered Member
Posts
15
Karma
0
OS

Re: akonadi confusion

Sat Feb 11, 2012 4:13 pm
Can I take it from the previous, that I should expect all stored mails to be in ~/.local/share/local-mail - or whatever is stored in kmail->Settings->Configure kmail->Accounts->Receiving->Local Folders ? Currently, this is not the case for my installation. Means, my kmail2 is misconfigured, correct ? How do I get it back into a correctly configured state with Local Folders in - say - $HOME/Mail in maildir format ?

Christoph Pospiech
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: akonadi confusion

Sun Feb 12, 2012 7:52 am
To do this, move both ~/.local/share/local-mail and ~/.local/share/.local-mail.directory/ to ~/Mail and ~/.Mail.directory respectively - then adjust Akonadi to point towards the new locations. I would advise doing the folder moves with Akonadi stopped.

And yes, as far as I am aware - all mail stored in Local Folders - unless you have duplicate Local Folders resources which have different settings - should be stored there.

(Note that there is no warranty - as always I recommend taking backups often when making configuration or other major changes involving PIM data)


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
cpospiech
Registered Member
Posts
15
Karma
0
OS

Re: akonadi confusion

Sun Feb 12, 2012 5:10 pm
Hi,

thanks for this information.

Apparently, my only mail copy exists in the (akonadi ? nepomuk ?) data base, which knows the folder the mail is stored in and uses a number that points to a file name in ~/.local/share/akonadi/file_db_data/<this_number>_r0. So I need to recreate the local folder structure from there. My plan would be to recreate the folder structure in a place where neither kmail2 nor akonadi knows about, then stop akonadi-server and switch the "Local Folders" to the new place. Sounds like a plan ? Well, I guess I still need some advice on how to precisely do this. For instance, can I create a new account in kmail->Settings->Configure kmail->Accounts->Receiving and point it to an existing mail dir structure (without kmail2 or akonadi getting confused about it) ?

Also, I can't recreate 19000 mails by hand, just using akonadiconsole->Browser for inspecting and a bash, mkdir, cp and chmod for recreating. I have to write a (C/C++) program or (perl ?) script for doing this. To this end I installed libakonadi-dev and started to inspect the header files in /usr/include/akonadi/private/ for an appropriate API that I could use. It seems as these header files define the d-bus interface (and such). I rather need to do SQL queries into the data base to retrieve the folder structure. Is libnepomuk-perl the right thing to use ? Unfortunately, /usr/lib/perl5/Nepomuk.pm is VERY short - only init() and normalize_classname() - not the SQL querys I was looking for. Can anyone point me to some documentation or get me started here ?

Thanks in advance !!

Christoph Pospiech
User avatar
einar
Administrator
Posts
3402
Karma
7
OS

Re: akonadi confusion

Mon Feb 13, 2012 11:20 pm
Apparently, my only mail copy exists in the (akonadi ? nepomuk ?) data base, which knows the folder the mail is stored in and uses a number that points to a file name in ~/.local/share/akonadi/file_db_data/<this_number>_r0

FYI, this is just a local cache - Akonadi doesn't store your mail in its database.


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
jarkod
Registered Member
Posts
1
Karma
0
OS

Re: akonadi confusion

Sun Feb 19, 2012 11:41 pm
So where does it store it? Because apparently it doesn't store it in ~/local/share/local-mail. It contains only empty catalogs cur, new and tmp. The only file that seem to store mail is ibdata1 located /home/jarek-k0/.local/share/akonadi/db_data/. And it means that akonadi does store mail in some form of a data base.

By the way, how's that possible that logfile is 6 times bigger that a file itself (ib_logfile1 vs. ibdata1)?

I'm using KDE 4.8 on Kubuntu 11.10.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: akonadi confusion

Mon Feb 20, 2012 7:24 am
Have you tried checking the directory I mentioned above, ~/.local/share/.local-mail.directory/?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
cpospiech
Registered Member
Posts
15
Karma
0
OS

Re: akonadi confusion

Mon Feb 20, 2012 9:58 am
Hi,

the complete contents of my (=Christoph Pospiech) ~/.local/share/.local-mail.directory are listed in a previous post. No sign of the mails that I am looking for. Seems that my only mail copy is in ~/.local/share/akonadi/file_db_data. This is a cache only as I have learned. Mails that are not frequently touched are removed, because akonadi thinks there is another copy (which isn't the case in my - broken - installation). So I am currently loosing mails. I urgently need to get my akonadi configuration into a legal state.

My plan is to switch from /usr/sbin/mysqld-akonadi to external mysql (/usr/sbin/mysqld) and then use a perl script with DBD::mysql and various backups and ~/.local/share/akonadi/file_db_data to piece a new Local Mail structure together (using the indexing information from the akonadi data base) and let akonadi finally point to it. I am aware that I have to stop akonadi at various points in this procedure and restart it afterwards.

When switching the data base servers, what actions are precisely needed ? Can I keep the ib_logfile[01] ? Should I configure mysqld to use the same size for these files ? Do I need to move the msql data base from /var/lib/mysql (where it currently resides) to ~/.local/share/akonadi/db_data (where mysql is only an empty directory) ?

Could it be that user "jarkod" is in a similar situation ?

Christoph Pospiech
cpospiech
Registered Member
Posts
15
Karma
0
OS

Re: akonadi confusion  Topic is solved

Sat Mar 03, 2012 8:50 pm
Hi,

I finally solved my problem. Thanks for all the hints and answers.

For some reason (yet unknown) the sub directories in local-mail got lost. I could be that I myself deleted them early after migration. Then kmail2 apparently stores everything in cache as it cannnot store it in local-mail.

I wrote a perl script with DBI::mysql API that extracts the local-mail directory structure from the aconadi data base and recreates it. It also reads the emails in akonadi cache (aka data field in parttable from database akonadi) and moves the emails to their proper place in local-mail.

After running the script, I re-created the akonadi data base. kmail2 now runs smoothly.

Christoph Pospiech


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell