aboutsummaryrefslogtreecommitdiff
path: root/txt/get-mailboxes.txt
blob: b6ceff0a388bc7f7bf684c095d6b709bed116548 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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