From 2cb2fa03452cb99537a1751961574a0b6d3253e0 Mon Sep 17 00:00:00 2001 From: Aisha Tammy Date: Sat, 15 May 2021 22:16:15 -0400 Subject: [PATCH 1/2] allow dynamically loading available mailboxes this way if a folder is added or deleted in the remote location, and gets deleted after sync, it is reflected in the next opening Signed-off-by: Aisha Tammy --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index 54af276..ebd0fdb 100755 --- a/bin/mw +++ b/bin/mw @@ -227,7 +227,7 @@ getboxes() { if [ -n "${force+x}" ] ; then fi [ "$type" = "pop" ] && mailboxes="INBOX" getaccounts; for x in $(seq 1 9); do echo "$accounts" | grep -q "^$x:" || { export idnum="$x"; break ;}; done - toappend="mailboxes $(echo "$mailboxes" | sed "s/^/\"=/;s/$/\"/" | paste -sd ' ' - )" + toappend="mailboxes \`mdir=$maildir/$fulladdr/; find \$mdir -type d -name cur | sort | sed -e 's:/cur\$:\":' -e \"s:\$mdir:\\\"=:\" | tr '\\\n' ' '\`" for x in $mailboxes; do case "$x" in *[Ss][Ee][Nn][Tt]*) setBox record "$x"; formatShortcut s sent "$x" ;; From 2a50561834c23565bd5587972dff5cc9de53dd57 Mon Sep 17 00:00:00 2001 From: Aisha Tammy Date: Wed, 19 May 2021 18:57:43 -0400 Subject: [PATCH 2/2] set mindepth to 1 and move sort to after sed Signed-off-by: Aisha Tammy --- bin/mw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mw b/bin/mw index ebd0fdb..3cc3d78 100755 --- a/bin/mw +++ b/bin/mw @@ -227,7 +227,7 @@ getboxes() { if [ -n "${force+x}" ] ; then fi [ "$type" = "pop" ] && mailboxes="INBOX" getaccounts; for x in $(seq 1 9); do echo "$accounts" | grep -q "^$x:" || { export idnum="$x"; break ;}; done - toappend="mailboxes \`mdir=$maildir/$fulladdr/; find \$mdir -type d -name cur | sort | sed -e 's:/cur\$:\":' -e \"s:\$mdir:\\\"=:\" | tr '\\\n' ' '\`" + toappend="mailboxes \`mdir=$maildir/$fulladdr/; find \$mdir -mindepth 1 -type d -name cur | sed -e 's:/cur\$:\":' -e \"s:\$mdir:\\\"=:\" | sort | tr '\\\n' ' '\`" for x in $mailboxes; do case "$x" in *[Ss][Ee][Nn][Tt]*) setBox record "$x"; formatShortcut s sent "$x" ;;