One of my customers recently approached me and told me to give a detailed list of his mail accounts and mail usage. The script I used for this purpose is given below.
Script to list Mailbox disk usage in Plesk
if [ -d /var/qmail/mailnames ]; then echo -ne "nn=== MAILBOXES ===n"; cd /var/qmail/mailnames && TMB=$(du -ks */* 2>/dev/null | sort -nr | cut -f2); if [ -n "$TMB" ]; then echo "$TMB" | xargs du -sh; fi; echo "[`find . -mindepth 2 -maxdepth 2 -type d | wc -l` Mailboxes - Total `du -hs | cut -f1`]"; fi; === MAILBOXES === 140K example.com/mhtest 116K example.com/test 112K example212.com/gary 112K 123example.com/drotis 76K example456.com/jim 76K example546.com/admin [6 Mailboxes - Total 676K]
Feel free to modify