How to Manage Zimbra Account Status from CLI

There are 5 states of any Zimbra account as explained below. We can use the zmprov command to change the status of an account.

  • Active: Active is the normal status for a mailbox account. Mail is delivered and users can log into the client interface.
  • Maintenance: When a mailbox status is maintenance, login is disabled and mail addressed to the account is queued at the MTA.
  • Locked: When a mailbox status is locked, the login is disabled until you unlock the account, but mail is still delivered to the account. Locked can be set if you suspect that a mail account has been hacked or is being used in an unauthorized manner.
  • Closed: When a mailbox status is closed, the login is disabled. This status is used to soft-delete an account. The account exists until you delete it.
  • Lockout: Users who try to log in and have forgotten their password are temporarily locked out after a specified number of consecutive failed login attempts. An account’s status is automatically changed to lockout. How long the account is locked out is set by COS or Account configuration, but you can change the lockout status at any time.

Examples

Below are some of the examples which you can use to change the state of a Zimbra account.
1. To lockout a zimbra account manually:

$ zmprov ma geeklab@example.com  zimbraAccountStatus lockout

2. To bring an inactive/locked account to normal(active) state, use the below command:

$ zmprov ma shahzad@example.com zimbraAccountStatus active

3. To close or soft-delete an account, you can use the below command:

$ zmprov ma shahzad@example.com zimbraAccountStatus closed
Related Post