Page 1 of 1

[SOLVED] Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir

PostPosted: Apr 25th, '12, 19:34
by mab33
Our domestic LAN has 2 desktops and a laptop, all using Mandriva 2010.2, but are looking to move over to Mageia-2 in due course.
When away from home we clone email/documents/Pan etc. setups, and on return update the same apps on the desktops.
All is simple to do with Rsync - except (now) KMail.
With the earlier KMail on Mandriva a KMail email database can be cloned into the laptop with one command (on laptop):

rsync -avx --delete desktop:/home/user/.kde4/share/apps/kmail/mail/
/home/user/.kde4/share/apps/kmail/mail

and vice-versa on return.

With KMail 4.8.2 in Mageia-2-Beta3, the email database has gained a complicated addressing mechanism such that I have been unable to continue to use KMail in its 4.8.2. form, rendering the above rsync approach unusable.
Can anyone suggest a way around the stalemate? (Other than using IMAP...)

Failing a solution, I am going to have to either stop using KMail altogether (I'm trying out Evolution, and shall try Thinderbird when they implement maildir (possibly in T'bird 12)).
I am also trialling openSUSE 12.1 with opensuse-kde3 (as at 3.5.10), which provides pre-Akonadi KMail - wonderful!

Finally. when experimenting with KMail 4.8.2, I've managed to screw it up so it won't even start now ("Failed to fetch the resource collection - fatal error" - what does that mean?!). Tried uninstalling/re-installing - same error.
Anyone know how to get KMail to start again from scratch?!

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir emails

PostPosted: Apr 26th, '12, 21:50
by djennings
Ummm From what I read Kmail is going backwards in terms of usability. I suspect I shall be using OperaMail in Mageia 2

To reset your Kmail you may have to delete the SQL database which you will find in ~/.local/share/akonadi
You may find Kmail is easier to manage and you use fewer system resources if you instruct akonadi to use Sqlite instead of MYSQL.
To use SQLITE edit ~/.config/akonadi/akonadirc and change
QMYSQL to QSQLITE3 and restart your desktop session. The sqlite database will appear in ~/.local/akonadi

You may have to use QSQLITE instead of QSQLITE3 if Kmail complains about not being able to find the plugin.

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir emails

PostPosted: Apr 26th, '12, 23:13
by mab33
Thanks for the tip about KMail and akonadi.
OK, so that may get KMail running again, but the problem I have is the inability to update the email content of its database, or clone it onto my laptop for use away from home. That I can do with earlier versions of KMail.

So I can't see a way forward with the 4.8.2 KMail, so am looking for a replacement.

Thunderbird doesn't have maildir yet (though may be in T'bird 12, I hear), otherwise I would give that another try.
I have also been trying the latest Evolution (3.4.1, in Mageia-2's library), and I think I could use that, as it has an excellent Backup/Restore facility that can be used to clone the email.
I found a way of getting it to accept my Kmail email collection - except for Inbox, which it steadfastly declines to take under its wing; a mystery still.

Overall I found the Mageia-2 beta-3 install very good; smooth and effective (though there is a difficulty getting it to use LABEL= rather than UUID's in /etc/fstab; also when formatting a partition, it does not offer a choice of file system.

The running system seems quite smooth and slick; works well, and it does not impose all kinds of fancy KDE woktop trimmings by default, as e.g. openSUSE 12.2 does.

All it needs - for me - is something like the pre-Akonadi KMail.
( One solution I'm trying is open-suse-kde3 (3.5.10) on openSUSE 12.1 - a real treat!)

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir emails

PostPosted: Apr 27th, '12, 13:56
by djennings
I just had a play with kmail-4.8.2 in Mageia RC1
It seems to work OK if I select the Maildir folder to 'synchronise' automatically.

I could put new mails into the Maildir>new folder and when kmail started up it recognised a new mail.
Similarly I could remove mails from Maildir>cur folder and when kmail started it would recognise the mail was no longer there.

Isn't that what you need?

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir emails

PostPosted: Apr 27th, '12, 17:15
by mab33
> It seems to work OK if I select the Maildir folder to 'synchronise' automatically

How/where does one do that?

It sounds as though it might solve the problem.
E.g. to clone the desktop's KMail Inbox into the laptop:

rsync -avx --delete desktop:/home/user/.local/......./inbox/ /home/user/.local/..../inbox

and vice-versa.

Will try that out next time I'm on Mageia.

Thanks for the tip!

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir emails

PostPosted: Apr 27th, '12, 17:21
by djennings
How/where does one do that?


Right click on the maildir folder. It is one of the properties

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir emails

PostPosted: Apr 27th, '12, 19:50
by mab33
Right click on the maildir folder. It is one of the properties


Ah, yes - I see it - but it's a bit confusing:

Next, click on 'Retrieval'. The top option is 'Use options from parent folder or account'', and it is selected.
Next below it is 'Synchronise when selecting this folder'. It is selected, but greyed out, so 'Use options'' has to be deselected, upon which the 'Synchronise' option comes alive!
I think that default was a big mistake for KDE to make, as it can (as it did me) deter users from using KMail because of the apparent lack of a synchronise option.

I changed that setting on Inbox and Sent-Mail, then rsync'd the maildir files over from my older Mandriva KMail:

rsync -avx /mdv2010.2-home/user/.kde4/share/apps/kmail/mail/inbox/ /home/user/.local/share/local-mail/inbox
rsync -avx /mdv2010.2-home/user/.kde4/share/apps/kmail/mail/sent-mail/ /home/user/.local/share/local-mail/sent-mail

(During the rsync I also had KMail open, and one could see the messages pouring into the Inbox & Sent-Mail folders -
Instant feedback as to what was happening!)

Then - as I had several Inbox sub-folders - I copied the .inbox.directory over (this time adding the directory):
rsync -avx /mdv2010.2-home/user/.kde4/share/apps/kmail/mail/.inbox.directory /home/user/.local/share/local-mail

That all worked quickly and smoothly - far neater than the clumsy (and faulty) 'Import' facility, and it also avoids having the imported emails in a separate 'KMail-Import' folder.

My friend, you're a genius! That one tip has made the difference between me abandoning KMail and staying with it!
(At least it will when I can confirm that the routine cloning of emails between desktop and laptop via rsync does indeed work well. (It is so much quicker via rsync because only new or changed files are actually copied, which is why maildir is so important in this context compared woth mbox.)

Can't do much more for the moment as I have visitors over the weekend.

Many thanks once again...

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir emails

PostPosted: Apr 27th, '12, 20:18
by djennings
Glad it worked out. Could you edit the title of the original post to include [Solved] please.

Now if only I could get Kmail to work properly with IMAP folders :cry:
When setting up an IMAP account it keeps going into 'offline' mode. I wish they had just left Kmail alone. It worked fine in 3.5.10 but then so much of KDE is inferior now compared to previously.
Quanta is gone altogether, amarok2 is a mess (although Clementine is a very nice replacement), and whatever happened to koffice? My KDE desktop now consumes so much memory my computer with 3GB of RAM starts thrashing in and out of swap if I have too many applications open. I know it is getting better, but I still have to switch into LXDE when KDE gets too frustrating. Still, mustn't grumble.

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir emails

PostPosted: Apr 27th, '12, 20:26
by mab33
djennings wrote:Now if only I could get Kmail to work properly with IMAP folders


Evolution seems quite IMAP oirentated.

One burning question w.r.t. KMail: What is the 'Local Folders' account for?
KMail didn't used to have one. Why do we need one now? What does it do?
(N.B. Evolution also has Local Folders...)

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir [SOLVED

PostPosted: Apr 30th, '12, 12:36
by mab33
On April 27th I said:

> One burning question w.r.t. KMail: What is the 'Local Folders' account for?
> KMail didn't used to have one. Why do we need one now? What does it do?
(I notice that Evolution also has a Local Folder account...)

I would like to know also if the 'Local Folders' account can be deleted, as the 'Local Folders' reports just muddle up the main feedback.

Could someone here clarify this, please?

Re: [SOLVED] Kmail 4.8.2 in Magiea-2 Beta3: Importing maildi

PostPosted: Apr 30th, '12, 20:37
by doktor5000
I don't know Kmail, but thunderbird also has such a folder, but normally it's collapsed and at the end of the list.

Re: [SOLVED] Kmail 4.8.2 in Magiea-2 Beta3: Importing maildi

PostPosted: May 2nd, '12, 00:12
by djennings
I did an install of Mageia 2 RC today and was able to confirm that the 'Local Folder' account by default points to a set of Maildir directories in ~/.local
If you edit the Local Folders account you can point it to your existing Maildirs

Re: [SOLVED] Kmail 4.8.2 in Magiea-2 Beta3: Importing maildi

PostPosted: May 2nd, '12, 12:24
by mab33
djennings wrote:I did an install of Mageia 2 RC today and was able to confirm that the 'Local Folder' account by default points to a set of Maildir directories in ~/.local
If you edit the Local Folders account you can point it to your existing Maildirs


Sounds like an exact copy of what Evolution has been doing for some time!
(However, bizarrely, Evo refuses to have anything to do with any 'Inbox' directory. Also, it doesn't 'point' into existing Maildir folders, it absorbs them.
For example, I handed it the address of a copy of my /kmail/mail directory.
The result was that - after it had absorbed the contents - all that was left in the copy of the /kmail/mail directory was the Inbox directory, which it had ignored!.
Also, Evo defaults the address of the maildir directory to be absorbed as <user>, i.e. one's user login name. The intention is presumably to facilitate homing in on the desired maildir directory. But the big danger is that if one accidentally hits 'OK' prematurely it will treat the whole of one's /home directory as a maildir directory and absorb it all as email folders, leaving /home a completely unusable shambles!
(I speak from bitter experience, and have posted an Evo warning Bug Report!)

In my case - as I described earlier - I have populated the Local Folders with my Mandriva email collection, and it is working well - except for the fact that whenever I do anything to any of the Local Folders (e.g. delete an email, or read one in) a message window pops up reporting what is happening e.g. "Deleting in Local Folder".
Is there any way of inhibiting such intrusive messages?

I found also that KMail had not provided a default 'Drafts' Local Folder, and when I asked it to add one, it didn't appear (until I had logged out and back in again!).

Re: [SOLVED] Kmail 4.8.2 in Magiea-2 Beta3: Importing maildi

PostPosted: May 3rd, '12, 11:15
by mab33
djennings wrote:I did an install of Mageia 2 RC today and was able to confirm that the 'Local Folder' account by default points to a set of Maildir directories in ~/.local
If you edit the Local Folders account you can point it to your existing Maildirs


I hadn't realised that. (There is no 'Local Folders' account in KDE 4.5.2's KMail - just Send & Receive server accounts.)
In this case, where does KMail 4.8.2 keep its email database structure files?
Separate from the nominated email maildir directory, in /.akonadi?

I shall give that a try in the Mageia-2-Beta3 install I'm trialling.
(If it truly maps onto the given /kmail/mail directory - including Inbox - then that looks the simplest way of importing one's existing email 'maildir' database.)

N.B. Evolution uses 'maildir++', a Gnome(?) extension of 'maildir'.

Presumably the above method provides the ability to clone an instance of kmail+email from one Mageia install to an identical install on another m/c.
(Bring up kmail on target m/c and point its Local Directory to a copy of the other m/c's email directory structure.)
With the help of 'synchronise folder', should that also cope with updating the target m/c's KMail with a replacement email directory from the other?

That's the sort of thing I do regularly with KDE 4.5.2's KMail, when taking the laptop away from home, achieved with one command:

rsync -avx --delete newpc:/home/user/.kde4/share/apps/kmail/mail/ /home/user/.kde4/share/apps/kmail/mail

Re: [SOLVED] Kmail 4.8.2 in Magiea-2 Beta3: Importing maildi

PostPosted: May 3rd, '12, 14:36
by mab33
mab33 wrote:I hadn't realised that. (There is no 'Local Folders' account in KDE 4.5.2's KMail - just Send & Receive server accounts.)
In this case, where does KMail 4.8.2 keep its email database structure files?
Separate from the nominated email maildir directory, in /.akonadi?

I shall give that a try in the Mageia-2-Beta3 install I'm trialling.
(If it truly maps onto the given /kmail/mail directory - including Inbox - then that looks the simplest way of importing one's existing email 'maildir' database.)


Just tried it. First, to 'empty' KMail, I hid the 'akonadi' and 'local-mail' folders.
Then I copied my current Mandriva /kmail/mail directory to /home, gave 'Local Folders' the address of that folder in /home, and pressed OK.

Nothing appeared to happen, so I exited Kmail and started it again. Nothing.
So I logged out/in, and started KMail. Then I saw the directory structure of my Mandriva email, and as I selected each folder it picked up its email and eventually all looked good.
Fortunately It had remembered settings such as POP/SMTP servers, and filters, and so I was soon up and running.

Also, I can see that the Mandriva /Kmail/mail structure is still intact, with the same number of subfolders and files - and that the 'local-mail' directory in ~/.local/share
is empty, and there is a new populated 'akonadi' directory.

It remains for me to confirm that I can update the 'local folders' Mandriva email copy (additions and/or deletions) such that KMail 4.8.2 will sychronise to reflect the changes (for when e.g. I shall be away from base with laptop).

This method seems far preferable to the formal Import function (which failed to import Sent-Mail), and to the ad hoc rsync straight into Local Folders.

Re: Kmail 4.8.2 in Magiea-2 Beta3: Importing maildir emails

PostPosted: May 3rd, '12, 16:23
by mab33
mab33 wrote:
Right click on the maildir folder. It is one of the properties


Ah, yes - I see it - but it's a bit confusing:

Next, click on 'Retrieval'. The top option is 'Use options from parent folder or account'', and it is selected.
Next below it is 'Synchronise when selecting this folder'. It is selected, but greyed out, so 'Use options'' has to be deselected, upon which the 'Synchronise' option comes alive!
.


I was mistaken. Each folder's Retrieval option is preset to "Use options from parent folder". The parent folder of all Local Folders has the 'Synchronise' option set, so that will be inherited by all subfolders. No need to set in individual folders.