User Tools

Site Tools


internet:mail:zimbra:zimbra_cli

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
internet:mail:zimbra:zimbra_cli [2017/08/02 13:14]
gcooper
internet:mail:zimbra:zimbra_cli [2023/03/02 13:36] (current)
gcooper
Line 1: Line 1:
 ====== Zimbra Command Line Tools ====== ====== Zimbra Command Line Tools ======
- 
-===== CLI Examples ===== 
  
 http://wiki.zimbra.com/wiki/Zmmailbox http://wiki.zimbra.com/wiki/Zmmailbox
Line 9: Line 7:
 http://wiki.zimbra.com/wiki/Administration_Console_and_CLI_Certificate_Tools http://wiki.zimbra.com/wiki/Administration_Console_and_CLI_Certificate_Tools
  
-==== Delete All Mail in a Folder ====+===== Delete All Mail in a Folder =====
  
 First, you might want to move all folders you want to delete, then run the following command on "/Trash". First, you might want to move all folders you want to delete, then run the following command on "/Trash".
Line 17: Line 15:
 </file> </file>
  
-==== Delete All Mail in an Account ====+===== Delete All Mail in an Account =====
  
 :!: The above command may be less dangerous to use, but may be a little more work. :!: The above command may be less dangerous to use, but may be a little more work.
Line 29: Line 27:
 </file> </file>
  
-==== List All Users ====+===== List All Users ====
 + 
 +https://dilliganesh.wordpress.com/2014/03/23/list-out-all-account-in-zimbra/
  
 <file> <file>
 su - zimbra su - zimbra
-zmprov -l gaa |grep -v -e galsync -e spam -e ham -e virus > /tmp/zimbra_users.txt+zmprov -l gaa | grep -v -e galsync -e spam -e ham -e virus | sort > /tmp/zimbra_users.txt 
 +</file> 
 + 
 +For a domain: 
 + 
 +<file> 
 +zmprov -l gaa yourdomain.tld | grep -v -e galsync -e spam -e ham -e virus | sort > /tmp/yourdomain_users.txt 
 +</file> 
 + 
 +===== Get All Addresses ===== 
 + 
 +**get-all-addresses.sh** 
 + 
 +<file> 
 +#!/bin/bash 
 +set -o nounset   # exit on unset variables 
 +set -o errexit   # exit if command exits with non-zero value 
 +if [ "$(whoami)" != "zimbra" ]; then 
 +  echo "This script must be run as the zimbra user." 
 +  exit 1 
 +fi 
 +RESULTS=( $(zmprov -l gaa -v | grep -E "zimbraMailAlias|zimbraMailDeliveryAddress" ) ) 
 +EMAILS=( ${RESULTS[@]/zimbraMail*/} ) 
 +for EMAIL in "${EMAILS[@]}"; do 
 +  echo "$EMAIL" 
 +done 
 +zmprov gadl 
 +</file> 
 + 
 +===== Manage CoS ===== 
 + 
 +:!: ''defaultExternal'' can't be used for regular accounts. 
 + 
 +Show all CoS: 
 + 
 +<file> 
 +zmprov gac 
 +</file> 
 + 
 +Enable a zimlet for all CoS: 
 + 
 +<file> 
 +for cos in `zmprov gac`;do zmzimletctl acl <zimlet_name> $cos grant; done 
 +</file> 
 + 
 +Modify a setting for all CoS: 
 + 
 +<file> 
 +for cos in `zmprov gac`; do zmprov mc $cos zimbraFeatureResetPasswordStatus enabled; done 
 +</file> 
 + 
 +Show accounts per Class of Service: 
 + 
 +<file> 
 +zmprov cta domain.tld 
 +</file> 
 + 
 +Change the CoS for an account: 
 + 
 +<file> 
 +zmprov sac user@domain.tld another-cos
 </file> </file>
internet/mail/zimbra/zimbra_cli.1501701262.txt.gz · Last modified: 2017/08/02 13:14 by gcooper