You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-user@james.apache.org by Robin Bankhead <ap...@headbank.co.uk> on 2013/11/02 14:49:45 UTC
Maildir with hierarchical filesystem layout
Hello,
I've been doing things with the mailbox-maildir code, while also
learning a bit about namespaces, and I came across this:
org.apache.james.mailbox.maildir.MaildirStore.maildirDelimiter = ".";
Simple question: If I simply changed this to '/' (and reinstated the
commented-out code in that file that references it), would this *in
theory* be all that'd be required to enable a hierarchical on-disk
layout?
I have the luxury of breaking stuff at the moment, and I like the idea
of the maildir hierarchy being mirrored in the actual filesystem. To
my mind it would have the benefit of relieving the (albeit not too
onerous) limitations on subdirs-per-dir, and be more intuitive to boot.
I'd just welcome a heads-up if anyone who knows the Mailbox codebase
better than I (so, pretty much anyone) happens to know that it's going
to be a lot more work than it looks like it might be.
Thanks,
Robin Bankhead
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org
Re: Maildir with hierarchical filesystem layout
Posted by Robin Bankhead <ap...@headbank.co.uk>.
OK, initial testing went well, so here it is:
https://issues.apache.org/jira/browse/MAILBOX-200
As I mention there, it needs to be configurable to be
production-ready, and learning how to do that is pretty low down my
list right now (getting sieve working comes first!) but if anyone
cares to point me at any useful info on that subject, I'll take a look.
Robin Bankhead
Quoting Robin Bankhead <ap...@headbank.co.uk>:
> Happy to (pending testing), if you think you *do* gain anything from
> it; in this instance it was more in the manner of scratching a
> personal itch, not so much destined for core adoption. But if you
> think it's worthwhile, then I'll throw it on there.
>
> Robin Bankhead
>
> Quoting Eric Charles <er...@apache.org>:
>
>> Thx. Can you open a JIRA on
>> https://issues.apache.org/jira/browse/MAILBOX and explain what we
>> gain with this patch?
>>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org
Re: Maildir with hierarchical filesystem layout
Posted by Robin Bankhead <ap...@headbank.co.uk>.
Happy to (pending testing), if you think you *do* gain anything from
it; in this instance it was more in the manner of scratching a
personal itch, not so much destined for core adoption. But if you
think it's worthwhile, then I'll throw it on there.
Robin Bankhead
Quoting Eric Charles <er...@apache.org>:
> Thx. Can you open a JIRA on
> https://issues.apache.org/jira/browse/MAILBOX and explain what we
> gain with this patch?
>
> On 03/11/13 10:54, Robin Bankhead wrote:
>>
>> Quick reply to my own question: No, not quite that simple.
>>
>> The commented-out code only addresses translation from absolute folder
>> path to mailbox path, so I also had to add similar translation to the
>> getFolderName() method. Also, as
>> MailboxConstants.DEFAULT_DELIMITER_STRING is now (char)
>> DEFAULT_DELIMITER, that had to change too.
>>
>> The below patch is not yet tested, but I reckon it should create the
>> folders as intended.
>>
>> Robin Bankhead
>>
>>
>> Index: MaildirStore.java
>> --- MaildirStore.java Base (BASE)
>> +++ MaildirStore.java Locally Modified (Based On LOCAL)
>> @@ -41,7 +41,7 @@
>> public static final String PATH_FULLUSER = "%fulluser";
>> public static final String WILDCARD = "%";
>>
>> - public static final String maildirDelimiter = ".";
>> + public static final String maildirDelimiter = "/";
>>
>> private String maildirLocation;
>>
>> @@ -192,8 +199,8 @@
>> // remove leading dot
>> mName = folderName.substring(1);
>> // they are equal, anyways, this might change someday...
>> - //if (maildirDelimiter !=
>> MailboxConstants.DEFAULT_DELIMITER_STRING)
>> - // mName = mName.replace(maildirDelimiter,
>> MailboxConstants.DEFAULT_DELIMITER_STRING);
>> + if (maildirDelimiter.charAt(0) !=
>> MailboxConstants.DEFAULT_DELIMITER)
>> + mName = mName.replace(maildirDelimiter.charAt(0),
>> MailboxConstants.DEFAULT_DELIMITER);
>> return mName;
>> }
>>
>> @@ -213,6 +220,8 @@
>> if (!root.endsWith(File.pathSeparator))
>> folder.append(File.separator);
>> folder.append(".");
>> + if (maildirDelimiter.charAt(0) !=
>> MailboxConstants.DEFAULT_DELIMITER)
>> + name = name.replace(MailboxConstants.DEFAULT_DELIMITER,
>> maildirDelimiter.charAt(0));
>> folder.append(name);
>> return folder.toString();
>> }
>>
>>
>> Quoting Robin Bankhead <ap...@headbank.co.uk>:
>>
>>> Hello,
>>>
>>> I've been doing things with the mailbox-maildir code, while also
>>> learning a bit about namespaces, and I came across this:
>>>
>>> org.apache.james.mailbox.maildir.MaildirStore.maildirDelimiter = ".";
>>>
>>> Simple question: If I simply changed this to '/' (and reinstated the
>>> commented-out code in that file that references it), would this *in
>>> theory* be all that'd be required to enable a hierarchical on-disk
>>> layout?
>>>
>>> I have the luxury of breaking stuff at the moment, and I like the idea
>>> of the maildir hierarchy being mirrored in the actual filesystem. To
>>> my mind it would have the benefit of relieving the (albeit not too
>>> onerous) limitations on subdirs-per-dir, and be more intuitive to boot.
>>>
>>> I'd just welcome a heads-up if anyone who knows the Mailbox codebase
>>> better than I (so, pretty much anyone) happens to know that it's going
>>> to be a lot more work than it looks like it might be.
>>>
>>> Thanks,
>>> Robin Bankhead
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org
Re: Maildir with hierarchical filesystem layout
Posted by Eric Charles <er...@apache.org>.
Thx. Can you open a JIRA on
https://issues.apache.org/jira/browse/MAILBOX and explain what we gain
with this patch?
On 03/11/13 10:54, Robin Bankhead wrote:
>
> Quick reply to my own question: No, not quite that simple.
>
> The commented-out code only addresses translation from absolute folder
> path to mailbox path, so I also had to add similar translation to the
> getFolderName() method. Also, as
> MailboxConstants.DEFAULT_DELIMITER_STRING is now (char)
> DEFAULT_DELIMITER, that had to change too.
>
> The below patch is not yet tested, but I reckon it should create the
> folders as intended.
>
> Robin Bankhead
>
>
> Index: MaildirStore.java
> --- MaildirStore.java Base (BASE)
> +++ MaildirStore.java Locally Modified (Based On LOCAL)
> @@ -41,7 +41,7 @@
> public static final String PATH_FULLUSER = "%fulluser";
> public static final String WILDCARD = "%";
>
> - public static final String maildirDelimiter = ".";
> + public static final String maildirDelimiter = "/";
>
> private String maildirLocation;
>
> @@ -192,8 +199,8 @@
> // remove leading dot
> mName = folderName.substring(1);
> // they are equal, anyways, this might change someday...
> - //if (maildirDelimiter !=
> MailboxConstants.DEFAULT_DELIMITER_STRING)
> - // mName = mName.replace(maildirDelimiter,
> MailboxConstants.DEFAULT_DELIMITER_STRING);
> + if (maildirDelimiter.charAt(0) !=
> MailboxConstants.DEFAULT_DELIMITER)
> + mName = mName.replace(maildirDelimiter.charAt(0),
> MailboxConstants.DEFAULT_DELIMITER);
> return mName;
> }
>
> @@ -213,6 +220,8 @@
> if (!root.endsWith(File.pathSeparator))
> folder.append(File.separator);
> folder.append(".");
> + if (maildirDelimiter.charAt(0) !=
> MailboxConstants.DEFAULT_DELIMITER)
> + name = name.replace(MailboxConstants.DEFAULT_DELIMITER,
> maildirDelimiter.charAt(0));
> folder.append(name);
> return folder.toString();
> }
>
>
> Quoting Robin Bankhead <ap...@headbank.co.uk>:
>
>> Hello,
>>
>> I've been doing things with the mailbox-maildir code, while also
>> learning a bit about namespaces, and I came across this:
>>
>> org.apache.james.mailbox.maildir.MaildirStore.maildirDelimiter = ".";
>>
>> Simple question: If I simply changed this to '/' (and reinstated the
>> commented-out code in that file that references it), would this *in
>> theory* be all that'd be required to enable a hierarchical on-disk
>> layout?
>>
>> I have the luxury of breaking stuff at the moment, and I like the idea
>> of the maildir hierarchy being mirrored in the actual filesystem. To
>> my mind it would have the benefit of relieving the (albeit not too
>> onerous) limitations on subdirs-per-dir, and be more intuitive to boot.
>>
>> I'd just welcome a heads-up if anyone who knows the Mailbox codebase
>> better than I (so, pretty much anyone) happens to know that it's going
>> to be a lot more work than it looks like it might be.
>>
>> Thanks,
>> Robin Bankhead
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org
Re: Maildir with hierarchical filesystem layout
Posted by Robin Bankhead <ap...@headbank.co.uk>.
Quick reply to my own question: No, not quite that simple.
The commented-out code only addresses translation from absolute folder
path to mailbox path, so I also had to add similar translation to the
getFolderName() method. Also, as
MailboxConstants.DEFAULT_DELIMITER_STRING is now (char)
DEFAULT_DELIMITER, that had to change too.
The below patch is not yet tested, but I reckon it should create the
folders as intended.
Robin Bankhead
Index: MaildirStore.java
--- MaildirStore.java Base (BASE)
+++ MaildirStore.java Locally Modified (Based On LOCAL)
@@ -41,7 +41,7 @@
public static final String PATH_FULLUSER = "%fulluser";
public static final String WILDCARD = "%";
- public static final String maildirDelimiter = ".";
+ public static final String maildirDelimiter = "/";
private String maildirLocation;
@@ -192,8 +199,8 @@
// remove leading dot
mName = folderName.substring(1);
// they are equal, anyways, this might change someday...
- //if (maildirDelimiter != MailboxConstants.DEFAULT_DELIMITER_STRING)
- // mName = mName.replace(maildirDelimiter,
MailboxConstants.DEFAULT_DELIMITER_STRING);
+ if (maildirDelimiter.charAt(0) != MailboxConstants.DEFAULT_DELIMITER)
+ mName = mName.replace(maildirDelimiter.charAt(0),
MailboxConstants.DEFAULT_DELIMITER);
return mName;
}
@@ -213,6 +220,8 @@
if (!root.endsWith(File.pathSeparator))
folder.append(File.separator);
folder.append(".");
+ if (maildirDelimiter.charAt(0) != MailboxConstants.DEFAULT_DELIMITER)
+ name = name.replace(MailboxConstants.DEFAULT_DELIMITER,
maildirDelimiter.charAt(0));
folder.append(name);
return folder.toString();
}
Quoting Robin Bankhead <ap...@headbank.co.uk>:
> Hello,
>
> I've been doing things with the mailbox-maildir code, while also
> learning a bit about namespaces, and I came across this:
>
> org.apache.james.mailbox.maildir.MaildirStore.maildirDelimiter = ".";
>
> Simple question: If I simply changed this to '/' (and reinstated the
> commented-out code in that file that references it), would this *in
> theory* be all that'd be required to enable a hierarchical on-disk
> layout?
>
> I have the luxury of breaking stuff at the moment, and I like the
> idea of the maildir hierarchy being mirrored in the actual
> filesystem. To my mind it would have the benefit of relieving the
> (albeit not too onerous) limitations on subdirs-per-dir, and be more
> intuitive to boot.
>
> I'd just welcome a heads-up if anyone who knows the Mailbox codebase
> better than I (so, pretty much anyone) happens to know that it's
> going to be a lot more work than it looks like it might be.
>
> Thanks,
> Robin Bankhead
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org