Zimbra Tips : How to Get All User Quota

Posted by

This script originating from Zimbra Wiki: Getting_All_Users_Quota_Data. I just create a little modification to the script to suit my environment.

This script has features

  • It works for Zimbra single server or multi servers
  • The script will collect all user quota and save as CSV
  • Script use semicolon as separator
  • The CSV file will be sent to email. So, you can open using LibreOffice calc for easy reading

Please run this script on the mailbox server. If you have multiple mailboxes, just put this script to one of your mailbox servers.

curl -k https://raw.githubusercontent.com/imanudin11/script/master/checkquota.pl > /opt/zimbra/libexec/checkquota.pl
curl -k https://raw.githubusercontent.com/imanudin11/script/master/checkquota.sh > /srv/checkquota.sh
chmod +x /opt/zimbra/libexec/checkquota.pl
chmod +x /srv/checkquota.sh

Open checkquota.sh and adjust the following lines with your environment

emailSender="quotareport@imanudin.net";
emailRecipient="admin@imanudin.net";
mtaServer="localhost";

If you have Zimbra multi server installation, change mtaServer with your MTA server. Install swaks application for sending email

yum install swaks
or
apt install swaks

Run the script

/srv/checkquota.sh

Please check the email that has been setup in the script. You can find an email like the one below

You can open attachment (CSV file) using LibreOffice calc for easy reading

Good luck 🙂

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.