How to check mailbox size of all accounts in Zimbra mail server.

Zimbra Mail

Today, I would like to know a mailbox size of all users in my Zimbra mail server and I can check these sizes by create a shell script which has 2 commands for query.

  1. zmprov gaa => I use this command for query all accounts in my Zimbra server.
  2. zmmailbox -z -m your-account gms => Get mailbox size of your-account account.

Anyway, You can download my script too.


[ad#ad-post-1]

#!/bin/bash
all_account=`zmprov gaa`;
for account in ${all_account}
do
    mb_size=`zmmailbox -z -m ${account} gms`;
    echo "Mailbox size of ${account} = ${mb_size}";
done

Download

0 0 votes
Article Rating
2 Comments
Inline Feedbacks
View all comments
Florian Lambert
8 years ago

Hello,

I had the same need but zmmailbox gms takes too long.
So I wrote a little script. This script read in the zimbra mysql the size_checkpoint.

https://github.com/talset/zimbraTools/blob/master/sizeAccount.pl

Example :
ssh zimbra@domain.com
su – zimbra
./sizeAccount.pl