It is also not a trivial matter to know if the mbox driver is "in use"; inIsn't it just enough to a) check if name is (something like) ~/mbox and if so then invoke mail_valid on INBOX and check if the returned DRIVER is of the type mbox? That seems rather straightforward. Can a client try to list folders before it is safe to invoke mail_valid?
particular, if INBOX is not selected then it is necessary to do the INBOX selection procedure (at least to the point of identifying the driver). A
I am (or was, read on) only concerned about normal use. If some genius decides he wants to subscribe manually to something like ~/mail/../mail/../mbox - that's his problem. Most imap clients will just use ~/mbox or mbox (or in unlikely case /homedir/mbox).further complexity is in knowing whether a file named "mbox" is the INBOX or some other file that happens to have that name (remember that multiple paths can refer to the same directory).
I can offer you some pointers as to how to go about doing this, should youI was looking into this almost by accident while looking into another problem (for local setup) and since then I decided on an alternative solution that solves both issues - therefore I don't care as much anymore.
wish to undertake the effort in your own copy, but I decline to get into
that business in the official source.
My real goal was to reconcile imapd and pine concept of where mbox is. imapd will by default look into ~ for folders, unlike pine which looks for them in ~/mail dir. Yes, it can be solved by using something like
set mail-subdirectory mail
in c-client.cf but then this breaks mbox driver as it will begin looking for ~/mail/mbox. One solution is to then disable mbox driver in both (RedHat way) but I can't do that easily as it is not obvious which mbox's are pine's and which unix mail's or something third. Another solution (one I am ashamed of thinking of and why I was trying to hide mbox) would be to teach pine to look for mbox in ~/mail. Much better is to change mailboxfile function used in imapd so that if it's asked for ~/mbox then do not translate that into ~/mail/mbox but just use it as it is (it also requires changing mbox driver to always use ~/mbox and not only mbox but that's trivial too). This also prevents display of mbox in folder list and it is all very easy to do.
Josko P.
P.S. Patched, recompiled - works - I love having source code :).
