#FIXME: Install notmuch mail indexer for mutt NOT TESTED YET # NB the following macro is already in mutt-wizard.muttrc #macro index \Cf "unset wait_keyread -p 'Enter a search term to find with notmuch: ' x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" apt-get install -y notmuch-mutt NEOMUTTCONF="$HOME/config/mutt/" MAILDIR="$HOME/.local/share/mail" # set by mutt-wizard setup cat >> ${NEOMUTTCONF}/muttrc <<'EOF' # notmuch set nm_default_uri = "notmuch:///home/default/.local/share/mail" virtual-mailboxes "My INBOX" "notmuch://?query=tag:inbox" macro index \ "unset wait_key/usr/bin/notmuch-mutt --prompt search~/.cache/mutt_results" \ "search mail (using notmuch)" macro index \ "unset wait_key/usr/bin/notmuch-mutt thread~/.cache/mutt_resultsset wait_key" \ "search and reconstruct owning thread (using notmuch)" tag-transforms "attachment" "@" \ "encrypted" "" \ "signed" "✎" tag-formats "attachment" "GA" \ "encrypted" "GE" \ "signed" "GS" EOF mkdir -p ${MAILDIR}/.notmuch/hooks cat > ${MAILDIR}/.notmuch/hooks/post-new.notmuch.example <