Re: binc 1.2 / Maildir++ depot

"Henry Baragar" <[email protected]> Thu, 25 Aug 2005 10:12:15 -0400
Newsgroups gmane.mail.imap.binc.devel
Organization Instantiated Software Inc.
Message-ID <[email protected]>
On Thu, 25 Aug 2005 08:14:38 -0400, Jerry Lundström  
<[email protected]> wrote:

> Dr. Michael J. Chudobiak wrote:
>> Jerry Lundström wrote:
>>  I don't know why maildir is limited to one root folder - but the  
>> imapdir-type depot definitely isn't limited that way. I use TB +  
>> binc/imapdir, and it works great.
>
Technically you mean Maildir++ (from Courier, defined by  
http://www.inter7.com/courierimap/README.maildirquota.html) and not just  
Maildir (from qmail, described by  
http://www.qmail.org/man/man5/maildir.html).

> Before more ppl send info on IMAPdir, no, there is no option to switch  
> to that. This is not a handfull of accounts, we have over 40.000  
> accounts.
>
> Even if IMAPdir support it, its not a reason why Maildir++ depot  
> shouldn't be able to support it also.
>

The IMAPdir design discussion provides lots of information about why  
Maildir++ should not be able support top level level folders (siblings of  
INBOX).  Unfortunately, I can not find the mail archive with the  
discussions.

Basically, the author of Maildir++ made a design decision to retain the  
Maildir directory as the INBOX folder so that Courier (or any other imap  
server that uses Maildir++) could be added to qmail installations without  
having to make any configuration changes to qmail nor to dot-qamil  
configuration files, which makes it very easy to add an IMAP server to an  
existing qmail environment (particularly a large one, with say 40,000  
accounts).  In order to main a coherent mapping strategy and to prevent  
name colisions between folders and Maildir (not Maildir++) mandatory files  
(e.g. new, cur, tmp), IMAP folders are mapped to subirectories named after  
the IMAP folder, but with a leading dot (".").  One of the consequences of  
this is that one can not create a folder that is sibling to the INBOX  
folder.  This was one of the impetuses for creating a IMAPdir.

A different design decision was made for IMAPdir:  the IMAP INBOX folder  
maps to the "IMAPdir/INBOX" directory instead of the "Maildir/." directory  
in order to avoid many of the limitations of the Maild++ design.  The  
consequence of this design decision is that the configuration of qmail  
(and dot-qmail files) needs to be changed, OR symbolic links need to be  
set up to map the old Maildir/Maildir++ configuration to the new IMAPdir  
configuration (which can be confusing to users and a potential source of  
errors).

You have two options:

1.  Advise your Thunderbird clients to set their "IMAP server directory"
     to "INBOX/", as follows:
        -> Account Settings
           -> Server Settings
              -> [Advanced...]
     This changes the mapping so that top-level IMAP folders get mapped
     to subfolders of INBOX and makes Thunderbird's default folder
     configuration work.  Note that bincimap v1.3 will include the
     IMAP NAMESPACE verb which will eliminate the need for users to
     manually change the "IMAP server directory".

2.  Convert to IMAPdir... here a sketch of a design that should work for  
you
     a.  Insert a script into the bincimap invocation sequence that sets the
         IMAP depot type depending on the existance of an IMAPdir directory
         - this script also has to return a error to the client if the
           Maildir has been chmod'ed to "+t", which is the mechanism used
           to tell qmail to defer delivery.
     b.  Write a script that visits every account and does:
         - chmod +t the Maildir (to prevent activity)
         - runs Maildir++2IMAPdir.pl, which makes a Maildir a shadow of
           IMAPdir
         - chmod -t the Maildir
     c.  Convert dot-qmail files to use IMAPdir instead of Maildir
         - for each account this can start as soon as the account has been
           converted
         - once an account has been converted, all new changes should
           make use of IMAPdir
     d.  Change the configuration of qmail to deliver to IMAPdir/INBOX
         by default (instead of Maildir)
     e.  Delete the Maildir shadow directories once the dot-qmail files
         have been converted
         - this can be done on an account by account basis
     As suggested by step b, there should be little or no outage during
     the conversion.


Regards,
Henry:-)







-- 
Henry Baragar
Instantiated Software Inc.
http://www.instantiated.ca