#!/bin/sh find "$1" -type d -name cur -printf '%h\n' | \ sed -e "s,^$1/,=,g" -e "s,^$1\$,$2," | \ egrep -v '^=(spool|discard|retrain(/(sp|h)am)?)$' | \ sort | xargs echo mailboxes