--- /dev/null
+#!/usr/bin/python
+
+"""Produce a "sorted" list of maildir paths based on subdirs."""
+
+from __future__ import print_function
+
+import os
+import sys
+
+
+IGNORED_DIRS = set((
+ 'drafts',
+ 'outbox',
+ 'templates',
+ '.inbox.directory',
+))
+
+
+def find_dirs(topdir, ignored):
+ """Walk the subdirs following the KDE layout."""
+ ret = []
+ for d in sorted(os.listdir(topdir)):
+ if d in ('cur', 'new', 'tmp'):
+ continue
+
+ fulld = os.path.join(topdir, d)
+ if d.startswith('.') or fulld in ignored:
+ continue
+ if not os.path.islink(fulld):
+ if os.path.isdir(os.path.join(fulld, 'cur')):
+ ret.append(fulld)
+ subdir = os.path.join(topdir, '.%s.directory' % d)
+ if subdir not in ignored and os.path.isdir(subdir):
+ ret.extend(find_dirs(subdir, ignored))
+
+ return ret
+
+
+def main(argv):
+ maildir = os.path.expanduser('~/.mail/')
+ results = []
+ ignored = set(os.path.join(maildir, x) for x in IGNORED_DIRS)
+
+ results = find_dirs(maildir, ignored)
+ print(' '.join('"%s"' % x for x in results))
+ return 0
+
+
+# Old logic that doesn't sort right.
+ for root, dirs, _ in os.walk(maildir, followlinks=False):
+ for d in ('cur', 'new', 'tmp'):
+ try:
+ dirs.remove(d)
+ except ValueError:
+ pass
+
+ dirs.sort()
+ for d in dirs[:]:
+ fulld = os.path.join(root, d)
+ if fulld in ignored:
+ dirs.remove(d)
+ elif not os.path.islink(fulld):
+ if os.path.isdir(os.path.join(fulld, 'cur')):
+ results.append(fulld)
+
+ print('\n'.join('"%s"' % x for x in results))
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv[1:]))
"^LINUX-390@VM\.MARIST\.EDU$" \
"^procps@freelists.org$" \
"@lists\.denx\.de$" \
- "@lists\.linux\.it$"
-subscribe -group gnu "(^bug-.*|-(dev(el)?|patches))@(non)?gnu\.org$" "@debbugs\.gnu\.org$" "^(auto(conf|make)|coreutils|libtool)@gnu\.org$"
+ "@lists\.linux\.it$" \
+ "@lists\.php\.net$" \
+ "^security@libgd\.org$"
+subscribe -group gnu \
+ "(^(bug|help|info)-.*|-(dev(el)?|patches))@(non)?gnu\.org$" \
+ "@debbugs\.gnu\.org$" \
+ "^(auto(conf|make)|coreutils|libtool)@gnu\.org$"
subscribe -group spec "-l@opengroup\.org$"
subscribe -group unicode "-users@unicode\.org"
set header_cache = ~/.cache/mutt/header
set message_cachedir = ~/.cache/mutt/message
-mailboxes `find ~/.mail/ \
- -regextype posix-extended -type d \
- '(' -regex '.*/(cur|new|tmp)$' -o -regex '.*/\.mail/(drafts|outbox|templates|\.inbox\.directory)$' -prune ')' \
- -name cur -printf '"%h" ' 2>/dev/null | sort`
+mailboxes `~/.config/mutt/list-mailboxes.py`
unmailboxes ~/.mail
-set sidebar_delim = '│'
-set sidebar_folderindent = yes
+set sidebar_divider_char = '│ '
+set sidebar_folder_indent = yes
set sidebar_format = '%B %* %N' # %F %S'
-set sidebar_indentstr = ' '
-set sidebar_shortpath = yes
-set sidebar_sort = yes
+set sidebar_indent_string = ' '
+set sidebar_short_path = yes
set sidebar_visible = yes
set sidebar_width = 30
+# Needed so stats show up in the sidebar.
+set mail_check_stats = yes
+set mail_check_stats_interval = 600
+
color sidebar_new brightred default
bind index \Ck sidebar-prev