Zimbra Tips : How To Reset To COS Value (Class Of Service)

Posted by

After set COS for all users as described on previous article, overall the value/features on COS has been rewrite for all users. However, i am still get default value for some users such as quotas. Quotas for some users still using default value (unlimited). if checked via Zimbra Admin | Manage | Account | right click and select edit for account which still using default value on quota, i get the following information

reset-to-cos

I could click Reset to COS value and automatically value of quota using COS rule. For some users such as 3-5 users, maybe i can do it manually via Zimbra admin. But if a lot of users who have the same value on quotas, manually process is need more time until done. I am decided to using Zimbra Command Line for the shorter time. The following is example command for reset value of quotas to COS rule.

zmprov ma admin@example.com zimbraMailQuota ""

Note : The above command will enforce admin@example.com for using zimbraMailQuota on COS rule. For enforce all users to using COS value, you could make a script as below

vi /srv/reset-to-cos.sh

Fill with the following line

#!/bin/bash

clear
rm /srv/reset-to-cos.zmp
echo "Retrieve zimbra user name..."

USERS=`su - zimbra -c 'zmprov -l gaa | sort'`;

for ACCOUNT in $USERS; do
echo "Enforce COS value for account $ACCOUNT"
echo "ma $ACCOUNT zimbraMailQuota ''" >> /srv/reset-to-cos.zmp
done

Give execute access and run the above script

chmod +x /srv/reset-to-cos.sh
sh /srv/reset-to-cos.sh

The result of the above script is file with name reset-to-cos.zmp which is located in /srv/ folder. Execute it file with the following command as user Zimbra

su - zimbra
zmprov < /srv/reset-to-cos.zmp

If you want to reset to COS value for another attribute, you could change zimbraMailQuota with other attribute/parameters.

Good luck and hopefully useful 😀

5 comments

  1. Hi,

    Nice to see your all documents. Such you have very good knowledge of zimbra.

    I would like to ask one question regarding zimbra admin, so can you share how to give limit rights to zimbra admin in open source?

  2. hi thank you for all your documents,
    i have one domain and 2 Cos (one default and another Externeldefault)
    i need to delete “externeldefault”but i can’t “error request invalid”‘
    thank you to give me some idears

Leave a Reply

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

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