From 3811e4be579a17d24400251933aaec704059bf98 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 8 Mar 2018 12:19:33 +0400 Subject: [PATCH 1/1] list mailboxes with cron, not offlineimap --- .crontab.d/mutt | 1 + .gitignore.d/mutt | 1 + .mutt/list-mailboxes | 6 ++++++ .mutt/muttrc | 4 ++-- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100755 .mutt/list-mailboxes diff --git a/.crontab.d/mutt b/.crontab.d/mutt index 6b170bf..c144ab5 100644 --- a/.crontab.d/mutt +++ b/.crontab.d/mutt @@ -1 +1,2 @@ 29 4 * * * [[ -d $VARDIR/mutt/header_cache ]] && echo '- *' >| $VARDIR/mutt/header_cache/.backup-filter && autoload -U zargs && zargs --no-run-if-empty -- $VARDIR/mutt/header_cache/*~*/.gitignore(.NDa+28) -- rm -- +6 * * * * ~/.mutt/list-mailboxes ~/mail =inbox >| $VARDIR/mutt/mailboxes diff --git a/.gitignore.d/mutt b/.gitignore.d/mutt index 6015555..4d243a4 100644 --- a/.gitignore.d/mutt +++ b/.gitignore.d/mutt @@ -15,6 +15,7 @@ !/.mutt/headers !/.mutt/hooks !/.mutt/keybindings +!/.mutt/list-mailboxes !/.mutt/lists !/.mutt/mailcap-edit-wrapper !/.mutt/muttrc diff --git a/.mutt/list-mailboxes b/.mutt/list-mailboxes new file mode 100755 index 0000000..5e2460c --- /dev/null +++ b/.mutt/list-mailboxes @@ -0,0 +1,6 @@ +#!/bin/sh + +find "$1" -type d -name cur -printf '%h\n' | \ + sed -e "s,^$1/,=,g" -e "s,^$1\$,$2," | \ + egrep -v '^=(spool|discard|retrain(/(sp|h)am)?)$' | \ + sort | xargs echo mailboxes diff --git a/.mutt/muttrc b/.mutt/muttrc index 2b54bdf..9315ab1 100644 --- a/.mutt/muttrc +++ b/.mutt/muttrc @@ -4547,9 +4547,9 @@ source $my_confdir/lists source $my_confdir/spam source $my_confdir/hooks -set my_offlineimap_mailboxes = "$VARDIR/offlineimap/mailboxes" set my_mutt_mailboxes = "$VARDIR/mutt/mailboxes" -source "cat $my_offlineimap_mailboxes $my_mutt_mailboxes 2>/dev/null|" +source "test -f $my_mutt_mailboxes && cat $my_mutt_mailboxes| +#source "$my_confdir/list-mailboxes $folder $spoolfile|" set alias_file="$my_confdir/aliases" source "test -f $alias_file && cat $alias_file 2>/dev/null || echo unset alias_file|" -- 2.39.5