[Dovecot] Support for Kmail maildir format
Has anyone looked into providing support in dovecot for Kmail folders? I would like to make my Kmail folders (on my main desktop system) available to my other systems (including over a VPN when I am travelling). Kmail is my main mail program and I have a lot of mail in a lot of folders, so I don't want to set up a separate IMAP service and move all the mail and folders.
Kmail's use of maildir seems to folow the basic maildir approach except that sub-folders are handled differently.
If you create a folder (say it is called ABC) in Kmail and start putting mail in it, Kmail creates a directory on the disk called ABC (not .ABC) and creates the cur, new and tmp folders within it to contain the email.
If you then create a subfolder of ABC (say it is called DEF, contained within the ABC folder), Kmail creates a directory on the disk called .ABC.directory and creates the DEF directory within that.
In other words, maildir directories are given the same name as the mail folder (with no leading dot) but sub-folders are contained in disk directories called .<folder-name>.directory.
I have taken a quick look at the dovecot code and am fairly sure this could be handled by a variant on the existing maildir code (e.g. by changes to maildir_fill_readdir and other routines). Has anyone tried this?
Graham
On Thursday 26 Jan 2006 17:35, Graham Cobb wrote:
If you create a folder (say it is called ABC) in Kmail and start putting mail in it, Kmail creates a directory on the disk called ABC (not .ABC) and creates the cur, new and tmp folders within it to contain the email.
If you then create a subfolder of ABC (say it is called DEF, contained within the ABC folder), Kmail creates a directory on the disk called .ABC.directory and creates the DEF directory within that.
Are you sure about that? If I create an imap folder it asks me whether I intend it to contain other folders OR messages.
Anne
On Thursday 26 Jan 2006 18:42, Anne Wilson wrote:
On Thursday 26 Jan 2006 17:35, Graham Cobb wrote:
If you create a folder (say it is called ABC) in Kmail and start putting mail in it, Kmail creates a directory on the disk called ABC (not .ABC) and creates the cur, new and tmp folders within it to contain the email.
If you then create a subfolder of ABC (say it is called DEF, contained within the ABC folder), Kmail creates a directory on the disk called .ABC.directory and creates the DEF directory within that.
Are you sure about that? If I create an imap folder it asks me whether I intend it to contain other folders OR messages.
I'm talking about Kmail's own local maildir folders, not Kmail using IMAP folders. I am not trying to access any IMAP folders from Kmail: I am trying to use IMAP to serve Kmail local folders to other mail clients.
If I ask Kmail to create a maildir folder in Local Folders it is happy for it to contain both messags and other folders. I use that heavily.
Graham
Graham Cobb wrote:
Has anyone looked into providing support in dovecot for Kmail folders? I would like to make my Kmail folders (on my main desktop system) available to my other systems (including over a VPN when I am travelling). Kmail is my main mail program and I have a lot of mail in a lot of folders, so I don't want to set up a separate IMAP service and move all the mail and folders.
Kmail's use of maildir seems to folow the basic maildir approach except that sub-folders are handled differently.
If you create a folder (say it is called ABC) in Kmail and start putting mail in it, Kmail creates a directory on the disk called ABC (not .ABC) and creates the cur, new and tmp folders within it to contain the email.
If you then create a subfolder of ABC (say it is called DEF, contained within the ABC folder), Kmail creates a directory on the disk called .ABC.directory and creates the DEF directory within that.
In other words, maildir directories are given the same name as the mail folder (with no leading dot) but sub-folders are contained in disk directories called .<folder-name>.directory.
I have taken a quick look at the dovecot code and am fairly sure this could be handled by a variant on the existing maildir code (e.g. by changes to maildir_fill_readdir and other routines). Has anyone tried this?
Graham
I confirm exactly as you describe: This is from rpm -q kdepim kdepim-3.5.0-1
On Thu, 2006-01-26 at 17:35 +0000, Graham Cobb wrote:
In other words, maildir directories are given the same name as the mail folder (with no leading dot) but sub-folders are contained in disk directories called .<folder-name>.directory.
I have taken a quick look at the dovecot code and am fairly sure this could be handled by a variant on the existing maildir code (e.g. by changes to maildir_fill_readdir and other routines).
Sounds pretty weird format, but yes, should be pretty simple to change Dovecot to handle that. But at least currently I don't want to accept any such patch to main Dovecot distribution.
I think it should be enough to change maildir_fill_readdir() for listing, and for opening/deleting/renaming just fix all the code in maildir-storage.c which contains MAILDIR_FS_SEP_S.
Has anyone tried this?
I doubt it :)
And does kmail work worse via IMAP, or why aren't you just renaming the folders to Maildir++ format and make all mail access through Dovecot?
On Thursday 26 Jan 2006 20:03, Timo Sirainen wrote:
And does kmail work worse via IMAP, or why aren't you just renaming the folders to Maildir++ format and make all mail access through Dovecot?
KMail handles imap mail without any problems, but it has one big weakness. It cannot adequately search messages. You are restricted to a few main headers - body searching is impossible on the imap folders.
Anne
Am Donnerstag, 26. Januar 2006 23:36, schrieb Anne Wilson:
weakness. It cannot adequately search messages. You are restricted to a few main headers
?
You can search for arbitrary headers.
body searching is impossible on the imap folders.
I never used this, but it quick test using kMail 1.9.1 seems to indicate that it does work.
Greetings,
Gunter
-- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ philosopher Ventre, who said, "Possibly the gods exist, and possibly
- http://aachen.uni-dsl.de/ - Der direkte Draht in's Hochschulnetz! + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ This is very similar to the suggestion put forward by the Quirmian
they do not. So why not believe in them in any case? If it's all true you'll go to a lovely place when you die, and if it isn't then you've lost nothing, right?" When he died he woke up in a circle of gods holding nasty-looking sticks and one of them said, "We're going to show you what we think of Mr Clever Dick in these parts..." -- (Terry Pratchett, Hogfather) +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+PGP-verschlüsselte Mails bevorzugt! +
On Friday 27 Jan 2006 07:32, Gunter Ohrner wrote:
Am Donnerstag, 26. Januar 2006 23:36, schrieb Anne Wilson:
weakness. It cannot adequately search messages. You are restricted to a few main headers
?
You can search for arbitrary headers.
OK - but often body searches are what's needed - for instance maybe I remember that someone called David posted a message sometime in December that had a useful tip about recording DVDs: that would have been easy to find when I had local mail, but it's impossible on my imap folders.
body searching is impossible on the imap folders.
I never used this, but it quick test using kMail 1.9.1 seems to indicate that it does work.
I believe it was planned, so maybe 1.9 introduced it. I'm in the
process of updating my systems, so I'll look forward to seeing that.
If that is done it removes my only problem with kmail. It is far and
away the most configurable of any MUA that I've seen.
Anne
On Thursday 26 Jan 2006 20:03, Timo Sirainen wrote:
And does kmail work worse via IMAP, or why aren't you just renaming the folders to Maildir++ format and make all mail access through Dovecot?
Although I don't want to make all my access through IMAP (mainly for performance and reliability reasons) I realised that there is a much easier solution than implementing Kmail's format in dovecot. I just create softlinks from the dovecot directory to the Kmail directories to make them look like Maildir++. This allows dovecot to export them to other clients.
I have created a shell script which goes through a Kmail folder store and creates all the softlinks. It handles both maildir and mbox format folders (as dovecot cannot handle both formats in one namespace the script puts the maildir folders in the main dovecot directory tree and the mbox folders in a .../mbox subtree).
The script is available at http://www.cobb.uk.net/imap-export. It is designed to be invoked as something like:
imap-export ~/Mail ~/dovecot
and it assumes the dovecot configuration includes something like:
namespace private { separator = / prefix = location = maildir:~/dovecot inbox = no hidden = no } namespace private { separator = / prefix = mbox/ location = mbox:~/dovecot/mbox inbox = no hidden = no }
Graham Cobb wrote:
On Thursday 26 Jan 2006 20:03, Timo Sirainen wrote:
And does kmail work worse via IMAP, or why aren't you just renaming the folders to Maildir++ format and make all mail access through Dovecot?
Although I don't want to make all my access through IMAP (mainly for performance and reliability reasons) I realised that there is a much easier solution than implementing Kmail's format in dovecot. I just create softlinks from the dovecot directory to the Kmail directories to make them look like Maildir++. This allows dovecot to export them to other clients.
I have created a shell script which goes through a Kmail folder store and creates all the softlinks. It handles both maildir and mbox format folders (as dovecot cannot handle both formats in one namespace the script puts the maildir folders in the main dovecot directory tree and the mbox folders in a .../mbox subtree).
The script is available at http://www.cobb.uk.net/imap-export. It is designed to be invoked as something like:
imap-export ~/Mail ~/dovecot
and it assumes the dovecot configuration includes something like:
namespace private { separator = / prefix = location = maildir:~/dovecot inbox = no hidden = no } namespace private { separator = / prefix = mbox/ location = mbox:~/dovecot/mbox inbox = no hidden = no }
Interesting. One question. Since there are namespaces, # REMEMBER: If you add any namespaces, the default namespace must be added # explicitly, ie. default_mail_env does nothing unless you have a namespace
But both of the above have inbox=no. Is it not required to have one namespace with inbox=yes? Sorry, I'm just learning about namespaces.
On Sat, 2006-02-04 at 07:59 -0500, Neal Becker wrote:
Interesting. One question. Since there are namespaces, # REMEMBER: If you add any namespaces, the default namespace must be added # explicitly, ie. default_mail_env does nothing unless you have a namespace
But both of the above have inbox=no. Is it not required to have one namespace with inbox=yes? Sorry, I'm just learning about namespaces.
It's not required, but its behavior in that case isn't exactly well defined. Apparently works now, but might not in future.
Also if the INBOX is /var/mail/user but the file doesn't exist, Dovecot probably won't show the INBOX at all then.
participants (5)
-
Anne Wilson
-
Graham Cobb
-
Gunter Ohrner
-
Neal Becker
-
Timo Sirainen