Zimbra anyone?

I used to work in an environment that required a great deal of attention to the maildrops within the infrastructure… Not a big deal aside from the fact that I knew nothing about Zimbra…. LOL (go figure right) or really anything about mail on this scale.  I think they had somewhere in the neighborhood of 3+ million users.  So in lieu of actually learning anything, (really it was a time issue, I just had to know what to do) I was able to compile a bunch of useful one-liners to tell me everything I needed to know, on demand.  So here it is, for anyone who uses Zimbra, I found this to be an invaluable asset, especially @ 3:00AM, being awakened from a dead sleep to solve space issues on maildrops in less than 15 minutes (the SLA, a-holes…). basically this loops though all the maildrops and prints the output on-screen showing the current new user creation MD (so that you don’t move more users there) and specifics about each MD that would allow you to best choose where to move users.  Possibly a space allocation in the contract would have resolved this issue (who the hell has unlimited space for emails?), but hey anything for the sale right? F’ing morons… Suffice it to say that I (well the entire team) spent a great deal of time deciding where to move users because there was no more disk space available… on a daily basis. LOL… I sure don’t miss those calls…


sortaroot = a created user account with elevated access and rsa keys for looping purposes.

Did you get the peter.inatech.com? Wow… right…

# automate some preliminary maildrop checks before moving users
# Source the machines file
source /etc/inatech/machines
# Verify all maildrop file systems

DATE=`date +%Y-%m-%d`
created=”`sudo su – sortaroot -c “ssh md112.peter sudo ‘/opt/zimbra/bin/zmprov gc peter | grep -i mailhostpool|cut -c21-56′”`”
echo “”
echo “The following string will determine which mail drop”
echo “is currently defined for new user creation: $created”
# Formatting
echo “”
echo “Mail Drop                 Size  Used Avail Use% Mounted on          Number of users   Maildrop in which new users are being created ”
echo “————————————————————————————————————————————”

for i in $MD
do printf “$i.peter.inatech.com”
mail=`sudo su – sortaroot -c “ssh -o connectTimeout=5 $i.peter df -kh |grep ‘/opt/zimbra/store’| cut -c20-61″`
nuser=`sudo su – sortaroot -c “ssh -o connectTimeout=5 $i.peter zcat /var/tmp/$i.quota.$DATE | wc -l”`
crfind=`sudo su – sortaroot -c “ssh -o connectTimeout=5 $i.peter sudo ‘/opt/zimbra/bin/zmprov gs $i.peter.inatech.com | grep “$created”‘”`
echo “$mail   $nuser            $crfind”


, , , , , , , , , ,

  1. I am no arTist, but it works… « A Technological Farce

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: