From: martin f. krafft Date: Thu, 8 Mar 2018 08:19:33 +0000 (+0400) Subject: list mailboxes with cron, not offlineimap X-Git-Url: https://git.madduck.net/etc/mutt.git/commitdiff_plain/3811e4be579a17d24400251933aaec704059bf98?ds=sidebyside;pf=etc list mailboxes with cron, not offlineimap --- 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|"