Last active
December 23, 2015 02:39
-
-
Save limed/b0b1e96bee3fe0b95915 to your computer and use it in GitHub Desktop.
This basically iterates through all the mailbox folders and counts the number of mail a particular mailbox has
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for i in `zmprov -l gas | grep 'mbox'`; do | |
| for j in $( zmprov -l gaa -s ${i} | egrep -v "^(spam|ham)" ); do | |
| total=0 | |
| echo -n "Total emails for $j = " | |
| for k in $( zmmailbox -z -m "$j" gaf | awk '{print $4}' | egrep -o "[0-9]+" ); do | |
| total=$(( total + k )) | |
| done | |
| echo $total | |
| done > /tmp/megacounteroutfile/${i}.outfile; | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment