aboutsummaryrefslogtreecommitdiff
path: root/txt/get-mailboxes.txt
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2026-07-12 11:08:50 +0200
committerPhilip Wittamore <philip@wittamore.com>2026-07-12 11:08:50 +0200
commit420ceb49b53a8fa9d8ba8443e42e50cd7bd7cea9 (patch)
tree3009f0564d75e3f7d1ca38507e7ebb92deaded07 /txt/get-mailboxes.txt
update
Diffstat (limited to 'txt/get-mailboxes.txt')
-rwxr-xr-xtxt/get-mailboxes.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/txt/get-mailboxes.txt b/txt/get-mailboxes.txt
new file mode 100755
index 0000000..b6ceff0
--- /dev/null
+++ b/txt/get-mailboxes.txt
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+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/\/cur$/\"/g' -e "s#^${maildir}/# \"+#" | sort`
+
+echo $MAILBOXES \ No newline at end of file