{"id":2391,"date":"2013-07-16T20:24:04","date_gmt":"2013-07-16T12:24:04","guid":{"rendered":"http:\/\/rmohan.com\/?p=2391"},"modified":"2013-07-16T20:29:15","modified_gmt":"2013-07-16T12:29:15","slug":"how-to-check-mailbox-size-of-all-accounts-in-zimbra-mail-server","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=2391","title":{"rendered":"How to check mailbox size of all accounts in Zimbra mail server"},"content":{"rendered":"<p>I would like to check 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.<\/p>\n<p>     1.    zmprov gaa => I use this command for query all accounts in my Zimbra server.<br \/>\n     2. zmmailbox -z -m your-account gms => Get mailbox size of your-account account<\/p>\n<p>For all user we can use use a bash script.<\/p>\n<p># su zimbra<br \/>\n#vim zmchkmailsize.sh<\/p>\n<p>#!\/bin\/sh<br \/>\nWHO=`whoami`<br \/>\nif [ $WHO = &#8220;zimbra&#8221; ]<br \/>\nthen<br \/>\nall_account=`zmprov -l gaa`;<br \/>\nfor account in ${all_account}<br \/>\ndo<br \/>\n    mb_size=`zmmailbox -z -m ${account} gms`;<br \/>\n        echo &#8220;Mailbox size of ${account} = ${mb_size}&#8221;;<br \/>\n        done<br \/>\nelse<br \/>\necho &#8220;Execute this script as user zimbra (\\&#8221;su &#8211; zimbra\\&#8221;)&#8221;<br \/>\nfi<\/p>\n<p>:wq<br \/>\n# chmod 755<br \/>\n# .\/zmchkmailsize.sh<\/p>\n<p>OUTPUT:<\/p>\n<p>Mailbox size of admin@example.com.com = 15.74 KB<\/p>\n<p>Mailbox size of spam.g1oxhlgg@example.com = 0 B<\/p>\n<p>Mailbox size of ham.hp_pg_h5@iexample.com = 0 B<\/p>\n<p>Mailbox size of virus-quarantine.cs29ig2sm@example.com = 0 B<\/p>\n<p>Mailbox size of xxx.yyy@example.com = 1.70 KB<\/p>\n<p>Mailbox size of xxx.yyy@example.com = 1.29 KB<\/p>\n<p>Mailbox size of xxx.yyy@example.com = 0 B<\/p>\n<p>Mailbox size of xxx.yyy@example.com = 0 B<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I would like to check 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.<\/p>\n<p> 1. zmprov gaa => I use this command for query all accounts in my Zimbra server. 2. zmmailbox -z -m your-account [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2391"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2391"}],"version-history":[{"count":2,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2391\/revisions"}],"predecessor-version":[{"id":2393,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/2391\/revisions\/2393"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}