This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
internet:mail:zimbra:zimbra_cli [2016/10/13 11:21] 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:// | http:// | ||
Line 9: | Line 7: | ||
http:// | http:// | ||
- | ==== 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 "/ | First, you might want to move all folders you want to delete, then run the following command on "/ | ||
Line 17: | Line 15: | ||
</ | </ | ||
- | ==== 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 24: | Line 22: | ||
< | < | ||
- | export ACCOUNT=" | + | export ACCOUNT=" |
for FOLDER in `zmmailbox -z -m $ACCOUNT gaf |awk '/\// {print $5}' | for FOLDER in `zmmailbox -z -m $ACCOUNT gaf |awk '/\// {print $5}' | ||
unset ACCOUNT | unset ACCOUNT | ||
</ | </ | ||
+ | ===== List All Users ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | < | ||
+ | su - zimbra | ||
+ | zmprov -l gaa | grep -v -e galsync -e spam -e ham -e virus | sort > / | ||
+ | </ | ||
+ | |||
+ | For a domain: | ||
+ | |||
+ | < | ||
+ | zmprov -l gaa yourdomain.tld | grep -v -e galsync -e spam -e ham -e virus | sort > / | ||
+ | </ | ||
+ | |||
+ | ===== Get All Addresses ===== | ||
+ | |||
+ | **get-all-addresses.sh** | ||
+ | |||
+ | < | ||
+ | #!/bin/bash | ||
+ | set -o nounset | ||
+ | set -o errexit | ||
+ | if [ " | ||
+ | echo "This script must be run as the zimbra user." | ||
+ | exit 1 | ||
+ | fi | ||
+ | RESULTS=( $(zmprov -l gaa -v | grep -E " | ||
+ | EMAILS=( ${RESULTS[@]/ | ||
+ | for EMAIL in " | ||
+ | echo " | ||
+ | done | ||
+ | zmprov gadl | ||
+ | </ | ||
+ | |||
+ | ===== Manage CoS ===== | ||
+ | |||
+ | :!: '' | ||
+ | |||
+ | Show all CoS: | ||
+ | |||
+ | < | ||
+ | zmprov gac | ||
+ | </ | ||
+ | |||
+ | Enable a zimlet for all CoS: | ||
+ | |||
+ | < | ||
+ | for cos in `zmprov gac`;do zmzimletctl acl < | ||
+ | </ | ||
+ | |||
+ | Modify a setting for all CoS: | ||
+ | |||
+ | < | ||
+ | for cos in `zmprov gac`; do zmprov mc $cos zimbraFeatureResetPasswordStatus enabled; done | ||
+ | </ | ||
+ | |||
+ | Show accounts per Class of Service: | ||
+ | |||
+ | < | ||
+ | zmprov cta domain.tld | ||
+ | </ | ||
+ | |||
+ | Change the CoS for an account: | ||
+ | |||
+ | < | ||
+ | zmprov sac user@domain.tld another-cos | ||
+ | </ |