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 <e...@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 <apache.ja...@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-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org

Reply via email to