aboutsummaryrefslogtreecommitdiff
path: root/bin/get-mailboxes.sh
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-05-10 18:48:35 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-05-10 18:48:35 +0200
commit4d4c0e81a0caace3dc035ff9010ee01ac162ec86 (patch)
tree42d045bcd2d003ebd30caf7c7d642e03002de35c /bin/get-mailboxes.sh
downloadneomutt-4d4c0e81a0caace3dc035ff9010ee01ac162ec86.tar.gz
neomutt-4d4c0e81a0caace3dc035ff9010ee01ac162ec86.tar.bz2
neomutt-4d4c0e81a0caace3dc035ff9010ee01ac162ec86.zip
update
Diffstat (limited to 'bin/get-mailboxes.sh')
-rwxr-xr-xbin/get-mailboxes.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/get-mailboxes.sh b/bin/get-mailboxes.sh
new file mode 100755
index 0000000..e1ff8ef
--- /dev/null
+++ b/bin/get-mailboxes.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+maildir=$1
+
+# Find these specific paths so they stick at the top of the list
+MAILBOXES='"+Inbox" "+Sent" "+Trash" "+Drafts" "+Junk" '
+
+#Find all other paths, excluding those from above
+MAILBOXES=$MAILBOXES`find "$maildir" -type d -name cur \
+ -a -not \( -ipath "*Inbox*" \
+ -o -ipath "*Sent*" \
+ -o -ipath "*Drafts*" \
+ -o -ipath "*Trash*" \
+ -o -ipath "*Junk*" \
+ \) | sed -e 's/${maildir}//g' -e 's/\/cur$/\"/g' -e "s#^${maildir}/# \"+#" | sort`
+
+echo $MAILBOXES