# http://www.mutt.org/doc/manual/manual-6.html#functions
+#bind generic \Cc exit
+#quit
+set quit=ask-no
+
bind index , current-middle
bind index t noop
bind index T noop
+bind index V collapse-all
bind index x tag-entry
bind index X tag-pattern
bind index <left> previous-line
set folder_format="sh -c '~/.config/mutt/folder.sh \"$@\"' -- '%f' '%F %d %8s'|"
# http://www.mutt.org/doc/devel/manual.html#index-format
-set index_format = "%4C %Z %?M?»& ?%s %* %B %-20.20n %D"
+set index_format = "%Z%?M?»& ?%s %* %B %-20.20n %D"
#set pager_format="-%Z- %C/%m [%[%H:%M]] %-17.17n %s"
# %?<sequence_char>?<optional_string>? print <opt> iff <seq> is non zero
# %?<sequence_char>?<if_string>&<else_string>?
#
-#set status_format="[%r] %h %f (%s) [%M/%m] [N=%n,*=%t,post=%p,new=%b]"
+set status_format="[%r] %h %f (%s) [%M/%m] [N=%n,*=%t,post=%p,new=%b]"
#set status_format="-%r-%v--[%?M?%M/?%m msgs%?n?, %n new?%?d?, %d del?%?F?, %F flag?%?t?, %t tag?%?p?, %p postp?%?b?, %b inc?%?l?, %l?]--(%f)--%s/%S-%>-%P-"
#set status_format="-%r-%v--[%?M?%M/?%m msgs%?n?, %n new?%?d?, %d del?%?F?, %F flag?%?t?, %t tag?%?p?, %p postp?%?b?, %b inc?%?l?, ?%?L?%L/?%?l?%l?]--(%f)--%s/%S-%>-%P-"
#set status_format="-%r-%v--[%?M?%M/?%m msgs%?n?, %n new?%?d?, %d del?%?F?, %F flag?%?t?, %t tag?%?p?, %p postp?%?b?, %b inc?%?l?, %l?]--(%f)--%s-%>-%P-"
#set status_format = "───[ Folder: %f ]───[%r%m messages%?n? (%n new)?%?d? (%d to delete)?%?t? (%t tagged)? ]───%>─%?p?( %p postponed )?───"
+
+# https://dev.mutt.org/doc/manual.html#ts-enabled
+# Set the terminal status line (title).
+set ts_enabled = yes
+set ts_status_format = "%v %h %f"
# breaking PGP/MIME.
# decode application/pgp
-set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
+set pgp_decode_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f 2>/dev/null"
+# 2>&1 | grep -E -v '^gpg:.+(aka|Signature made)'"
# verify a pgp/mime signature
-set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f 2>&1 | grep -E -v '^gpg:.+(aka|Signature made)'"
+set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f 2>/dev/null"
# decrypt a pgp/mime attachment
-set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f"
+set pgp_decrypt_command="gpg --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f 2>/dev/null"
# create a pgp/mime signed attachment
set pgp_sign_command="gpg --no-verbose --batch --quiet --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f"
-#!/usr/bin/python
+#!/usr/bin/python3
"""Produce a "sorted" list of maildir paths based on subdirs."""
from __future__ import print_function
import os
+from pathlib import Path
import sys
-IGNORED_DIRS = set((
+IGNORED_DIRS = {
'drafts',
'outbox',
'templates',
'.inbox.directory',
-))
+}
+MAILDIR_DIRS = {
+ 'cur', 'new', 'tmp',
+}
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'):
+ for d in sorted(topdir.iterdir()):
+ if d.name in MAILDIR_DIRS:
continue
- fulld = os.path.join(topdir, d)
- if d.startswith('.') or fulld in ignored:
+ if d 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
+ if not d.is_symlink():
+ if (d / 'cur').is_dir():
+ yield d
+ subdir = topdir / f'.{d.name}.directory'
+ if subdir not in ignored and subdir.is_dir():
+ yield from find_dirs(subdir, ignored)
def main(argv):
- maildir = os.path.expanduser('~/.mail/')
- results = []
- ignored = set(os.path.join(maildir, x) for x in IGNORED_DIRS)
+ maildir = Path('~/.mail/').expanduser()
+ ignored = {maildir / x for x in IGNORED_DIRS}
results = find_dirs(maildir, ignored)
- print(' '.join('"%s"' % x for x in results))
+ print(' '.join(f'"{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:]))
set strict_threads = yes
set sort_browser = alpha
set sort_aux = last-date-received
+set help = no
+set hide_missing = no
set hide_thread_subject = yes
#set menu_scroll = yes
set pager_context = 10
set sidebar_folder_indent = yes
set sidebar_format = '%B %* %N' # %F %S'
set sidebar_indent_string = ' '
+set sidebar_relative_shortpath_indent = no
set sidebar_short_path = yes
set sidebar_visible = yes
set sidebar_width = 30