Hi, Oskar,

On Sat, 15 Nov 2003, Oskar Bartenstein wrote:
>Is there a nice way to tweak bincimap to store mail folders
>in deep unix directory hierarchies instead of one big flat
>directory?

Probably yes; the changes would be in depot.cc and depot.h. You can create
your own Depot subclass & iterator, give it a name and set
depot=myNewDepot in bincimap.conf. Check out MaildirPPDepot and
IMAPdirDepot for examples and how to do it. Since the two share the same
type of Depot::iterator (which is used to traverse mailboxes in the
depot), you would have to rewrite this iterator to fit your depot. It
should be a proxy iterator, but it's not today so you can't reimplement
it in the subclasses.

Be aware of restrictions in RFC2060/RFC3501; one being that deleting a
parent IMAP mailbox does not imply deleting its inferiors.

Now, there are several reasons why Binc IMAP doesn't support a deep
structure. If you're aware of these, then I'll list them here for the sake
of the archives. :-)

(The Maildir++ depot follows the sensible parts of the Maildir++
specification from the Courier-IMAP team, so I won't talk about this now)

The IMAPdir depot allows arbitrary mailbox types; the only requirement
being that each mailbox on the file system can be identified as a file or
directory. If "a"  was an mbox, "a/b" was a Maildir and "a/b/c" was an
mbox, then there would be need for a more complex mapping between the
mailbox name (with path) and its filesystem representation. Obviously "a"
can't be a directory, since it's an mbox which a file. Since a flat
directory structure allows these types of combinations with no technical
tweaks, it's suitable for Binc IMAP.

Without a deep directory structure in the mailbox depot, the server also
avoids recursion, and having to create the directories a, a/b and a/b/c
when "c" is the only mailbox that actually exists.

Binc is all about K.I.S.S. :-).

There isn't any documentation on the Depot and Depot::iterator classes
yet; I'm working on full Doxygen documentation for every class in Binc
IMAP, but haven't got longer than docs for Mailbox and Message.

Good luck :-)

Andy

--
Andreas Aardal Hanssen   | http://www.andreas.hanssen.name/gpg
Author of Binc IMAP      |  "It is better not to do something
http://www.bincimap.org/ |        than to do it poorly."


Reply via email to