habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Zimbra Modiy Account with Class of Service

1 min read

Hi Dude, how to modify account zimbra set to specific class of service? In this article i will share some simple method. We can execute using the command if only one or two accounts. But what if there are hundreds of accounts? we can do it iteratively with script. This is simple method for Zimbra Modify Account COS.

Method 1: With Modify Account

This is first method with Zimbra Modify Account command. Before doing this, we must first know the COS ID. For that, we need the “grep” command.

Login as Zimbra User.

Get COS ID

Follow this command to get COS ID.

[root@mail2 ~]# su - zimbra
Last login: Thu Feb 16 09:36:01 WIB 2023 on pts/6
[zimbra@mail2 ~]$ zmprov -l gac
default
defaultExternal
name-of-cos

After get name of COS, grep the Zimbra ID.

[zimbra@mail2 ~]$ zmprov gc name-of-cos | grep -i 'zimbraId'
zimbraId: 2f3048b6-63e3-400e-99a3-d75c6faf0ef6

After get zimbra ID, we can modify account like below.

zmprov ma [email protected]  zimbraCOSId "2f3048b6-63e3-400e-99a3-d75c6faf0ef6"

For bulk account, we create a file that contains a list of emails. As an example.

Save, and execute this command.

for i in `cat cos-staff.txt `; do  zmprov ma $i  zimbraCOSId "2f3048b6-63e3-400e-99a3-d75c6faf0ef6" ;echo $i ;done

Method 2: With Set Account COS

As Zimbra user, run this command.

zmprov setAccountCos [email protected] NAME-COS
zmprov setAccountCos [email protected] NAME-COS

For bulk account, create script bash file example set-cos-account.sh.

vim set-cos-account.sh
#!/bin/bash

clear

echo "Retrieve zimbra user name..."

USERS=`cat cos-staff.txt`;

for ACCOUNT in $USERS; do
NAME=`echo $ACCOUNT`;
echo "Set COS for $NAME..."
su - zimbra -c "zmprov setAccountCos ${ACCOUNT} NAME-COS";
done
echo "COS All Account Set Successfull"

Finish, we already done modify account for COS. That is simple step Zimbra Modify Account COS.

habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Zimbra Relay Amazon SES

Zimbra is a widely used collaboration platform that provides robust email services. When it comes to improving email deliverability and ensuring the security of...
habibzain
1 min read

Install Zimbra 10 Ubuntu 20.04 from Scratch

Zimbra 10 may have had specific installation requirements, and there might be updates or changes beyond that point. Here is simple guide how to...
habibzain
4 min read

Zimbra Cannot start TLS: handshake failure

The Zimbra log show error message “Cannot start TLS handshake” typically indicates an issue with establishing a secure TLS (Transport Layer Security) connection. This...
habibzain
1 min read

Leave a Reply

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

Never miss good article from us, get weekly updates in your inbox