<<< Date Index >>>     <<< Thread Index >>>

how to generate a list of imap mailboxes



Hi

I use the following code snippet in my ~/.muttrc to generate a list of folders 
of my local imap server:

set mbox_type=Maildir
set mask="!^\\.[^.]"

mailboxes `\
echo -n "+ "; \
for file in /var/mail/Maildir/m8ram/.*; do \
  box=$(basename "$file"); \
  if [ ! "$box" = '.' -a ! "$box" = '..' -a ! "$box" = '.customflags' \
      -a ! "$box" = '.subscriptions' ]; then \
    echo -n "\"+$box\" "; \
  fi; \
done`


This generates a list like:
"+.INBOX" "+some_folder" "+some_folder.subfolder" "+.Sent"

If I want to change to a different folder I get a screen like:
 1   0                                 imaps://valinor/
 2   0                                 imaps://valinor/.some_folder
 3   0                                 imaps://valinor/.some_folder.subfolder
 4   0                                 imaps://valinor/.Sent
 5   0                                 imaps://valinor/.INBOX

But I can't use this screen to open a mailbox, I have to press tab to get a 
screen like:
 1     IMAP                                  somefolder.
 2     IMAP                                  INBOX
 3     IMAP                                  Sent

Selecting the "somefolder." line opens another screen:
 1     IMAP                                  ../
 2     IMAP                                  subfolder

I not really comfortable with this.
First I'd like to get rid of the first screen as it isn't really usefull to me 
at the moment.
Secondly I'd like to be able to read the messages in "somefolder" but I can't 
open that mailbox becuase I always get the subfolder selection sceen!

Isn't there a better way to generate the list of mailboxes?

Regards

Bram

-- 
# Mertens Bram "M8ram"   <bram-mertens@xxxxxxxx>   Linux User #349737 #
# debian testing            kernel 2.6.15-1-686    i686    1024MB RAM #
# 21:32:41 up 10 days,  4:28,  4 users,  load average: 0.00, 0.00, 0.00 #