Quote:
Originally Posted by anthonyclark I used "zmmailbox -d -z -m REMOVED@removed.edu gaf" and got the SOAP response back. Piping that into " grep -E '\"name\"|\"s\"' " will, with some editing, give you a per-folder list for that user. |
Thanks for the tip.
I found another way to get folder size by using mysql as zimbra user. The size information is in metadata field in mboxgroupX .mail_item table. Here are steps (and I have script if anyone is interested):
1. Find account's
zimbraID - zmprov ga <account> zimbraID
2. Find
folder id that you are interested - zmmailbox -z -m <account> gf /folder, store the id number in folder_id.
3. Find
group_id and
id using mysql from zimbra.mailbox table:
mysql -N -e "select group_id, id from zimbra.mailbox where account_id='zimbraID'
For next mysql select, the mboxgroup database is mboxgroup$group_id, and the mailbox_id is id.
4. Find the folder message count and size:
mysql -N -e "select size,metadata from $mboxgroup.mail_item mailbox_id=$mail box_id and id=$folder_id
The "size" field is actually the message counts in the folder, and the size of the folder is in
metadata, for example: you has something like this for the metadata:
d1:ai1e3:i4ri145047e4:mseqi307394e2:szi155818706e4 :unxti148219e1:vi10ee
The folder size is the number after the :szi, in bytes.