#!/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