X-Git-Url: https://git.madduck.net/etc/mutt.git/blobdiff_plain/7013dfe93a05082153f79eca6c9e5c05b54d9d50..d5ef8d19353a453275f0cbe5f1d6faf77fe23493:/.config/mutt/list-mailboxes diff --git a/.config/mutt/list-mailboxes b/.config/mutt/list-mailboxes index 497a253..d0bb5d5 100755 --- a/.config/mutt/list-mailboxes +++ b/.config/mutt/list-mailboxes @@ -1,6 +1,15 @@ #!/bin/sh +if [ -f $VARDIR/offlineimap/mailboxes ]; then + sed 1d $VARDIR/offlineimap/mailboxes +fi + find "$1/" -type d -name cur -printf '%h\n' | \ sed -e "s,^$1/,=,g" -e "s,^$1\$,$2," | \ - egrep -v '^=(sp(ool|am)|discard|retrain(/(sp|h)am)?)$' | \ - sort | xargs echo mailboxes + egrep -v '^=(sp(ool|am)|discard|retrain(/(sp|h)am)?)$' | sort | \ +while read mailbox; do + + ! grep -q "^mailboxes ${mailbox}\$" $VARDIR/offlineimap/mailboxes || continue + echo "mailboxes $mailbox" + +done