How to Manage Zimbra User Accounts using zmmailbox commands

To Manage Zimbra User Accounts

In this tutorial am going to explain basics of zmmailbox commands with examples. zmmailbox, when used via command-line interface in Zimbra, is used for checking the user account functions like Inbox, Send mail, Trash,&hellip etc. By using zmmailbox command, you can check the size of the user accounts present in Zimbra. It is also used for taking backup and restoring the zimbra accounts.

Using zmmailbox commands

To check the size of user accounts

If you want to check the size of the user accounts, make use of the following command.

[zimbra@mail root]$ zmmailbox -z -m test1@testdomain.io gms
20.44 KB

In the above command, gms denotes ' get mail size' so that the size of the user accounts is printed as output.

To check user account functions

If you want to check the functions of the user account use the following command.

[zimbra@mail root]$ zmmailbox -z -m test1@testdomain.io gaf
        Id  View      Unread   Msg Count  Path
----------  ----  ----------  ----------  ----------
         1  unkn           0           0  / 
        16  docu           0           0  /Briefcase
        10  appo           0           0  /Calendar
        14  mess           0           0  /Chats
       263  unkn           0           0  /Comments
         7  cont           0           0  /Contacts
         6  mess           0           0  /Drafts
        13  cont           0           1  /Emailed Contacts
         2  mess           0           2  /Inbox
         4  mess           0           0  /Junk
         5  mess           0           1  /Sent
        15  task           0           0  /Tasks
         3  unkn           0           1  /Trash

In the above command, gaf denotes ' get account functions' which displays all the functions that are present in the account of the said user.

To check the account functions through the user account

Another method to get user account details is to login directly into particular user. You can do that with the help of following command.

[zimbra@mail root]$ zmmailbox -z -m test1@testdomain.io
mailbox: test1@testdomain.io, size: 20.44 KB, messages: 5, unread: 0
authenticated as test1@testdomain.io
mbox test1@testdomain.io > 

Once you are inside the user account, use the following command to check the size of the account.

mbox test1@testdomain.io >  gms       
20.44 KB

List all the functions of the user with the help of following command.

mbox test1@testdomain.io >  gaf
       Id  View      Unread   Msg Count  Path
----------  ----  ----------  ----------  ----------
         1  unkn           0           0  /
        16  docu           0           0  /Briefcase
        10  appo           0           0  /Calendar
        14  mess           0           0  /Chats
       263  unkn           0           0  /Comments
         7  cont           0           0  /Contacts
         6  mess           0           0  /Drafts
        13  cont           0           1  /Emailed Contacts
         2  mess           0           2  /Inbox
         4  mess           0           0  /Junk
         5  mess           0           1  /Sent
        15  task           0           0  /Tasks
         3  unkn           0           1  /Trash


To Create a new folder

You can also create a new folder in your user account. Use the following command to create one.

mbox test1@testdomain.io >  cf /secure
264
Note : 264 is folder ID

mbox test1@testdomain.io >  gaf 
        Id  View      Unread   Msg Count  Path
----------  ----  ----------  ----------  ----------
         1  unkn           0           0  /
        16  docu           0           0  /Briefcase
        10  appo           0           0  /Calendar
        14  mess           0           0  /Chats
       263  unkn           0           0  /Comments
         7  cont           0           0  /Contacts
         6  mess           0           0  /Drafts
        13  cont           0           1  /Emailed Contacts
         2  mess           0           2  /Inbox
         4  mess           0           0  /Junk
         5  mess           0           1  /Sent
        15  task           0           0  /Tasks
         3  unkn           0           1  /Trash
       264  unkn           0           0  /secure

To delete folder

mbox test1@testdomain.io >   df /secure

To logout from the user shell

mbox test1@testdomain.io >   exit

To backup the zimbra user accounts

If you have to take a backup of the user accounts in Zimbra, you should use the following commands.

[zimbra@mail root]$ zmmailbox -z -m test1@tesdomain.io getRestURL " //?fmt=tar"  >  /backup/test1.tar.gz

To restore the backup into user account

[zimbra@mail root]$ zmmailbox -z -m test1@testdomain.io postRestURL " //?fmt=tar"   /backup/test1.tar.gz
Tag : Zimbra
FAQ
Q
how to take backup for the user accounts in zimbra?
A
$ zmmailbox -z -m test1@tesdomain.io getRestURL " //?fmt=tar" > /backup/test1.tar.gz
Q
what command is used to show the list of user folder in zimbra?
A
show the list of user folder in zimbra by following command
> gaf
Q
which command to find the usage of an account?
A
use the following command to view the usage of account
# zmmailbox -z -m test1@testdomain.io gms
Q
How To Create a folder under user account?
A
# zmmailbox -z -m test1@testdomain.io after entering into the terminal use " cf /secure"
Q
which command to delete the user folder in zimbra?
A
use the below command to delete the user folder for zimbra
# df /secure