Home » Get Mailbox usage report Zimbra

Get Mailbox usage report Zimbra

  • by

A way to get an emailable report of all mailboxes in a domain, their quota, usage and account status, so a domain admin can review their accounts without having to login to zimbra. (most of this is the same as viewing quota usage in zimbra admin, but this was easier, as it can then be emailed on a schedule)

Run following command as zimbra user to check all user’s mailbox size:

su - zimbra
all_accounts=`zmprov -l gaa`; for account in $all_accounts; do mbox_size=`zmmailbox -z -m $account gms`; echo "Mailbox size of $account = $mbox_size"; done ;

After running above commands you will get output in the below format:

Mailbox size of user@example.com = 5.72 KB
Mailbox size of user2@example.com = 1.38 KB
Mailbox size of test@example.com = 0 B
Mailbox size of test2@mydomain.com = 19.27 MB
Mailbox size of supporttest@supportlab.in = 162.15 KB

or you can using simple bash script like this below

I saved this file in as usagereport.sh, owned by zimbra.zimbra and dont forget to chmod 755 usagereport.sh

Then I just setup a cronjob crontab -e (as zimbra user) to run this at 4:01 every monday morning, and email it to them.

1 4 * * 1 /root/usagereport.sh

Leave a Reply

Your email address will not be published. Required fields are marked *

one × 1 =