On Mon, Aug 13, 2007 at 10:30:11PM +0100, MJ Ray wrote:
Chris G cl@isbd.net wrote:
On Mon, Aug 13, 2007 at 08:14:31PM +0100, MJ Ray wrote:
That's working exactly as specified - Maildir subfolder directory names must begin with a "." [...]
I don't think there is *any* requirement for maildir sub-folders to start with '.', it's a Courier thing, not a maildir thing. [...]
Think what you like, but at least Dovecot seems to share the requirement. As you note, basic maildir seems not to allow folders at all. The Python class seems to be using Courier maildir. It wouldn't be the first time mutt coped with stuff that doesn't follow specs.
The Courier way of doing things is not to have nested sub-directories at all, it just delimits them with dots and creates all the sub-directories at one level, e.g. :-
/home/isbd/Mail # root of all maildirs
/home/isbd/Mail/.folder1 /home/isbd/Mail/.folder2 /home/isbd/Mail/.folder2.sub-folder2a /home/isbd/Mail/.folder2.sub-folder2b /home/isbd/Mail/.folder2.sub-folder2b.sub-sub-folder2b1 ... etc.
This is fine when the structure is hidden behind an IMAP server (as it is with Dovecot or Courier) but it's *horribly* clumsy for direct use with an MUA. There's no way that I want my local mail hierachy to be like that, much of the point is that it can be easily navigated 'by hand' as it were and I can move stuff around, rename it, etc. myself and with scripts. Names like the ones that Courier uses make this really messy, for example if I wanted to rename folder2 to folderX it's rather difficult because, with the Courier way, I have to rename a whole lot of folders rather than just one. I expect it could be automated but why make things difficult when it's far simpler to just use real directories?
The trouble is (I suspect) that very few people now work with a live Unix style mail spool on the local system so the complexity or otherwise of what underlies their mail hierarchy doesn't affect them. I still much prefer to have my mail delivered to 'old' Unix way and, for this, the simplicity of the file naming etc. is important.
Sorry to ramble on! :-)
By the way the Python Mailbox class (in Python 5.1) does a lot of the things I want very simply. The list_folders() for Maildir isn't something I really needed to use so its odd operation isn't an issue.
In particular it's trivially easy to write a Python script to convert from mbox to Maildir (or back):-
#!/usr/bin/python # # # Mail manipulation # import mailbox import email import sys
mdir = mailbox.Maildir(sys.argv[1]) # argv[1] is maildir mbox = mailbox.mbox(sys.argv[2]) # argv[2] is mbox
for mdir_key in mdir.iterkeys(): mdir_str = mdir.get_string(mdir_key) mbox.add(mdir_str)
mbox.close()
It needs a few checks for non-existent folders and things like that but it works OK just with the above. The mbox.add() function is also just what I want for another utility I'm writing for merging mail into an archive. Previously I have used formail and mutt scripts neither of which are particularly elegant or simple.