DevHeads.net

Kmail message storage folders

I currently have Kmail on my server, with thousands of messages in Maildir
format on a separate partition (which simplifies migration/upgrading).
They're sorted into many subfolders such as 'cars', 'accounts', 'kde' etc.

I typically ssh into the server from whichever laptop I'm using and run Kmail
on the server via ssh, which avoids any syncing issues. However this does
mean my server is running for hours just for emails, which costs power.

I'm considering running kmail on a laptop and syncing every few days by
copying the new emails to the server's partition using 'cp' or Nautilus or
similar to copy recursively only new mailfiles. Can anyone confirm if this will
work? Is there a better way to sync?

One possible snag I can see is that kmail has created, in each folder such
as 'cars', subfolders called 'cur', 'new' and 'tmp'. Typically 'tmp' is empty
but both 'cur' and 'new' are full of messages. How does kmail (or
akonadi?) assign messages to 'cur' or 'new'? If it arbitrarily shifts
messages from one to the other then my copying idea will likely result in
numerous duplicate messages.

I've tried the Kmail documentation but it doesn't seem to throw any light on
this.

Chris

Comments

Re: Kmail message storage folders

By Kevin Krammer at 04/15/2018 - 05:21

On Samstag, 14. April 2018 16:01:33 CEST cr wrote:
I would suggest looking at rsync over ssh.

Cheers,
Kevin

Re: Kmail message storage folders

By =?UTF-8?Q?Nicol... at 04/14/2018 - 13:36

El 14 abr. 2018, a la(s) 11:01, cr < ... at orcon dot net.nz> escribió:
It's the standard Maildir format. 'new' has unread messages, 'cur' has read messages. They will be moved between folders when you mark messages as read or unread.

Re: Kmail message storage folders

By Frank Steinmetzger at 04/15/2018 - 07:25

On Sat, Apr 14, 2018 at 02:36:07PM -0300, Nicolás Alvarez wrote:
I use KMail only on my IMAP server and sync that to my machine using
Offlineimap. But once on my harddrive, my scenario is the same as yours:
read mail from one Maildir tree on several machines at the same time.

My approach is to use the syncing solution called Unison. That way I can
read and edit Mail on both machines, and unison detects all the changes in
the file system, including mail that was moved from new to cur after it was
read. As long as I don’t edit the same mail on both machines, Unison works
perfectly with this.

Re: Kmail message storage folders

By cr at 04/15/2018 - 08:33

Thanks. I see Unison is available as a .deb and I've just installed it on
both machines.

It looks as if that could be the optimum solution for my setup. All I need to
do now (after I've debugged why not all the emails in 'new' subdirectories
are showing up as 'unread') is do a one-time copy of the entire Maildir tree
to my laptop and thereafter, periodically keep it synced with Unison.
Hopefully.

Regards

Chris

Re: Kmail message storage folders

By cr at 04/15/2018 - 08:07

On Sat, Apr 14, 2018 at 02:36:07PM -0300, Nicolás Alvarez wrote:
Thanks for that. It's useful to know how it should work.

(Inspection shows that I have many more files in some 'new' subdirectories
than Kmail shows as 'unread'. Evidently akonadi is failing to notice them,
for some reason. I need to investigate that.)

Regards

Chris

Re: Kmail message storage folders

By Kevin Krammer at 04/15/2018 - 08:48

On Sonntag, 15. April 2018 14:07:24 CEST cr wrote:
The read/unread status is actually part of the filename.
I.e. a "read" message's filename contains an "S" (for Seen).

The new/cur is something else if I remember correctly.

Cheers,
Kevin

Re: Kmail message storage folders

By cr at 04/15/2018 - 09:20

On Sunday, 15 April 2018 2:48:48 PM NZST Kevin Krammer wrote:
Ah, now that appears to be consistent with what I can see. My 'Ford'
folder in kmail showed just 3 unread messages and just 3 of the files didn't
have 'S' at the end of their filename. I just marked them as 'read' in Kmail
and all the files now are suffixed 'S'.

Ford/'cur' and 'new' between them contain 119 files and Kmail is showing...
119 messages! So all present and correct. That's a relief. Thanks

Cheers

Chris

Re: Kmail message storage folders

By cr at 04/15/2018 - 09:46

On Monday, 16 April 2018 1:20:10 AM NZST cr wrote:
Umm, I've done some Googling.
Apparently, according to the Maildir specification, unread messages
should be in 'new' and should be moved to 'cur' when they are "found by a
cognizant maildir reading process" (whatever that means)
<a href="https://en.wikipedia.org/wiki/Maildir" title="https://en.wikipedia.org/wiki/Maildir">https://en.wikipedia.org/wiki/Maildir</a>
It should also attach suffixes such as 'S' for 'Seen' etc - which Kmail
evidently does.
My conclusion is that, for my purposes, I don't need to worry about 'cur' or
'new', the files all show up as messages in the respective Kmail folder.

Chris