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

Switching between important and non-important mailboxes



Hi,

This is something I wanted to have for some time, ability to make mutt
ignore certain mailboxes for some time, so that they don't bother me all
day, but to be able to review them when convenient.

Yesterday I bit the bullet and this is the result:

In .muttrc, I replaced my 'mailboxes' line with comment 

# MY_MAILBOXES \
        _+INBOX \
        _+postponed \
        +some_stuff \
        +cc-interest +dbx-interest +dtrace-discuss \
        _+mutt_users \
...

folders beginning with underscore are the important ones. Rest is:

macro index,pager y <esc>Y "Show important mail only"

########################################
# Important mailinglists
########################################
`cat $HOME/.muttrc | perl -e '                               \
  $tmp=join "", <>;                                          \
  $tmp=~s/\\\n//gs;                                          \
  $tmp=~m/\n#[ \t]*MY_MAILBOXES[ \t]*(.*?)\n/s;              \
  @all=split /\s+/, $1;                                      \
  $important=join " ", map { s/^_//; $_ } grep /^_/, @all;   \
  $all=join " ", map { s/^_//; $_ } @all;                    \
  print "mailboxes $all;";                                   \
  print "macro index,pager <esc>y \"<enter-command>unmailboxes 
*<enter><enter-command>mailboxes $all<enter><enter-command>color indicator blue 
white<enter><refresh><enter-command>macro index,pager y \\\\eY \\\"Show 
important mail only\\\"<enter>\"; "; \
  print "macro index,pager <esc>Y \"<enter-command>unmailboxes 
*<enter><enter-command>mailboxes $important<enter><enter-command>color 
indicator red white<enter><refresh><enter-command>macro index,pager y \\\\ey 
\\\"Show all mail\\\"<enter>\""; \
  print "\n";                                                \
'`


By pressing 'y' I switch between all mailboxes defined and just the
important ones. When I'm observing just the important ones, my indicator
turns red, and is blue otherwise.

Hope this helps someone

-- 
        Vlad

Attachment: pgpOY5t_HyEMH.pgp
Description: PGP signature