From 23c9ed5dea01349dd7c978265ad2dd2c53bc53e1 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 29 Mar 2023 10:16:01 +0200 Subject: [PATCH 1/1] use offlineimap mailboxes order --- .config/mutt/list-mailboxes | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 -- 2.39.5