项目作者: unai-ss

项目描述 :
some scripts to manage zimbra
高级语言: Shell
项目地址: git://github.com/unai-ss/zimbra_script.git
创建时间: 2018-03-18T16:15:21Z
项目社区:https://github.com/unai-ss/zimbra_script

开源协议:

下载


ZIMBRA SCRIPT

Little script for massive changes.

  • show_accounts_dumpster
  1. #!/bin/bash
  2. for acct in `/opt/zimbra/bin/zmprov -l gaa | grep -E -v '(^admin@|^spam\..*@|^ham\..*@|^virus-quarantine.*@|^galsync.*@)'|sort` ; do
  3. echo "Show dumpster $acct"
  4. zmmailbox -z -m $acct s --dumpster -l 30 --types message larger:1kb
  5. done
  6. done

In this case, we show the dumpster of each zimbra’s mailbox

Zimbra: Operate with Dumpster

  • delete_massive_mail
  1. #!/bin/bash
  2. # delete_massive_mail.sh user@domain.com
  3. addr=$1
  4. for acct in `/opt/zimbra/bin/zmprov -l gaa | grep -E -v '(^admin@|^spam\..*@|^ham\..*@|^virus-quarantine.*@|^galsync.*@)'|sort` ; do
  5. echo "Searching $acct"
  6. for msg in `/opt/zimbra/bin/zmmailbox -z -m "$acct" s -l 999 -t message "from:$addr"|awk '{ if (NR!=1) {print}}' | grep -v -e Id -e "-" -e "^$" | awk '{ print $2 }'`
  7. do
  8. echo "Removing "$msg" from "$acct""
  9. /opt/zimbra/bin/zmmailbox -z -m $acct gm $msg || echo "fail" && echo "good job"
  10. done
  11. done

In this case, we could make a massive delete of emails from a address mail.

Zimbra: Deleting message from account