Skip to content

Knowledge Linux

Linux server configuration,Zimbra

  • Home
  • Sitemap
  • Locate Us
  • Anti-Spam
  • Sitemap
  • Locate Us
  • Privacy & Cookie Policy
  • Directory Server
    • Open LDAP
    • Active Directory
  • LINUX KNOWLEDGE UNIVERSE
  • Mail Server
    • MDA
    • Microsoft Exchange
    • MTA
    • Postfix
    • Qmail
    • Webmail
    • Atmail Webmail
    • Hmail Webmail
    • Horde Webmail
    • iRed Webmail
    • RoundCube
    • Squirrel Webmail
  • Monitoring
    • Zimbra
  • Scriptology
  • Hosting Apps
    • BitNami
    • PHPList
    • Drupal
    • Moodle
    • PHPbb
    • Joomla
    • Magento
    • CakePHP
    • WordPress
Knowledge Linux
HOW TO RESTRICT MAIL USERS TO SEND MAIL LOCALLY IN ZIMBRA

how to check zimbra account status and quota size

September 24, 2015January 5, 2016 admin

how to check zimbra account status and quota size

how to check zimbra account status and quota size

 

Below scripts you can run using zimbra user, this scripts using zimbra native tool zmprov to fetch data from ldap and hold in different Variables after completing process scripts send status mails to configured mail id 

#!/bin/bash
output="/tmp/account_usage"
domain="knowledgelinux.com"
SendTo="admin@$domain"

rm -f $output;touch $output

server=`zmhostname`
/opt/zimbra/bin/zmprov gqu $server|grep $domain|awk {'print $1" "$3" "$2'}|sort|while read line
do
usage=`echo $line|cut -f2 -d " "`
quota=`echo $line|cut -f3 -d " "`
user=`echo $line|cut -f1 -d " "`
status=`/opt/zimbra/bin/zmprov ga $user | grep ^zimbraAccountStatus | cut -f2 -d " "`
echo "$user `expr $usage / 1024 / 1024`Mb `expr $quota / 1024 / 1024`Mb ($status account)" >> $output
done

cat $output | mail @SendTo -s"Mailbox Usages for $domain"

you can get such as below results. account current mailbox usage, assigned Mailbox size and accounts status

user1@knowledgelinux.com 51Mb 100Mb (active account)
user2@knowledgelinux.com 70Mb 100Mb (active account)
user3@knowledgelinux.com 91Mb 100Mb (closed account)
user4@knowledgelinux.com 24Mb 100Mb (active account)

For more information fellow below url.
https://wiki.zimbra.com/wiki/Mailbox_usage_report

Tagged with how to check zimbra account status and quota size, slid, zimbra accounts management through command line scripts
  • scriptology
  • Zimbra

Post navigation

Previous Post

zimbra prerequisite

Next Post

How to send mail from zimbra command line