[dovecot] Changing hierarchy separator to '/'
On Wed, 2003-04-16 at 01:03, Charlie Brady wrote:
From TODO:
... - maildir: change it to use '/' as hierarchy separator to allow '.' characters (for usernames in shared folders) ...
Now changing the separator in the maildir-storage.c is trivial (even though it "can't" be changed :-), but fixing the resultant breakage in maildir-list.c needs a little more understanding. Timo, could you give me some pointers? I can see that I need to work out what imap_match_init() does.
Did you want to change the '.' separator in filenames too? If not, just change all '/' chars in mask to '.' in maildir_list_mailbox_init().
imap_match_init() doesn't have to be touched, it gets the separator as parameter. It just initializes the matching so you can later test with imap_match() if the mask matches to mailbox name.
On 16 Apr 2003, Timo Sirainen wrote:
On Wed, 2003-04-16 at 01:03, Charlie Brady wrote:
From TODO:
... - maildir: change it to use '/' as hierarchy separator to allow '.' characters (for usernames in shared folders) ...
Now changing the separator in the maildir-storage.c is trivial (even though it "can't" be changed :-), but fixing the resultant breakage in maildir-list.c needs a little more understanding. Timo, could you give me some pointers? I can see that I need to work out what imap_match_init() does.
Did you want to change the '.' separator in filenames too?
Yes. AIUI, it's necessary to do so, otherwise there is confusion as to whether a . is literal or is a stand-in /.
To summarize:
- I'd like to use / as hierarchy separator, so that existing .mailboxlist files can be used (after moving them to ./Maildir/.subscriptions)
- I'd like to change the filename separator to ';' rather than '.', so that users can have folder names containing '.'.
- I don't care about Courier compatibility.
As an academic exercise, is there a reason other than Courier compatibility that subfolders can't be directories nested inside other directories? IOW, if we use / as the hierarchy separator, could we also use it in the filesystem paths of folders. (I realise that a reasonable amount of code would need to change to make this possible).
Regards
-- Charlie
On Thu, 2003-04-17 at 00:17, Charlie Brady wrote:
To summarize:
- I'd like to use / as hierarchy separator, so that existing .mailboxlist files can be used (after moving them to ./Maildir/.subscriptions)
- I'd like to change the filename separator to ';' rather than '.', so that users can have folder names containing '.'.
- I don't care about Courier compatibility.
Then you mostly just have to change '.' to ';' everywhere. And in maildir-list.c do the '/' -> ';' change in the search mask first to make it easier.
As an academic exercise, is there a reason other than Courier compatibility that subfolders can't be directories nested inside other directories? IOW, if we use / as the hierarchy separator, could we also use it in the filesystem paths of folders.
I'm not sure. I did think of doing this before, but I think I figured out some really good reason why the current way is better. Or maybe not, I can't remember.
(I realise that a reasonable amount of code would need to change to make this possible).
It wouldn't need that much code changes, mbox works that way and most of the code could be taken from there.
On 17 Apr 2003, Timo Sirainen wrote:
On Thu, 2003-04-17 at 00:17, Charlie Brady wrote:
As an academic exercise, is there a reason other than Courier compatibility that subfolders can't be directories nested inside other directories? IOW, if we use / as the hierarchy separator, could we also use it in the filesystem paths of folders. ... (I realise that a reasonable amount of code would need to change to make this possible).
It wouldn't need that much code changes, mbox works that way and most of the code could be taken from there.
There are significant differences from mbox, because a directory can be both a maildir and a container of other maildirs. That makes deletion and rename cases quite different. Or am I imagining these complications?
-- Charlie
participants (3)
-
Charlie Brady
-
Charlie Brady
-
Timo Sirainen