On Sun 19, Jul'09 at 10:03 PM -0600, lee wrote:
mailboxes `/path/to/script/listbox.py /path/to/mail/folders`

Thanks! Doesn't that need to produce some output, or does mutt have a
way to assign the content of "dirs" from the script to "mailboxes"?

The command in your muttrc ends up looking like "mailboxes +mailbox1 +mailbox2", which is the syntax mutt wants. Look up the 'mailboxes' command. All the script does is generate the "+mailbox1 +mailbox2" command. Of course, if you don't have to have the + part in front of the mailbox, but then you'd need the absolute path.

And it would require that there are exclusively maildirs in the
directory you supply as parameter to the script because it doesn't
distinguish between maildirs and directories. That's a distinction a
script needs to make.

Well, it was a quick script I wrote for *my* purposes. If you run mboxes instead of maildirs, you'd want to look for files and ignore directories, instead of vice-versa. Actually, I didn't even do that since I'm following the maildir standard (I think) of not having extraneous stuff in my top level mail folder.

Furthermore, I believe for a technically correct maildir structure, you shouldn't have subdirectories in that top level folder. See:
<http://wiki.mutt.org/?MuttFaq/Maildir>
I wanted to keep my mail compatible with an IMAP server if I so chose, so I am using the #1 suggestion in the link. So I have 'subfolders' named like so:
work.misc
work.proj1
work.proj2
personal.home
personal.friends
etc.

A script to automatically set up the mailboxes would have to check all
directories under ~/Mail and create mailbox statements for only those
that are maildirs.

See above. Not an issue in my case. Feel free to modify the code to suit your purposes. If you have a limited number of folders, you could always just call the code multiple times:
mailboxes `listbox.py /path/to/lists`
mailboxes `listbox.py /path/to/Per`
mailboxes `listbox.py /path/to/Gov`

Reply via email to