Hi,
The ./imquotacheck command provides an output of the quota usage per-user on the mail-store. With some simple scripting you can get the top-10 users per-quota usage e.g.
./imquotacheck | awk '{print $3 " " $1}' | grep '[0-9]' | sort -k1 -nr | head -10
*NOTE*
YOU NEED TO TEST THE FOLLOWING YOURSELF VERY CAREFULLY ON A TEST SERVER
INCORRECT USAGE COULD DELETE LOTS OF MAIL ON YOUR SYSTEM
To expire (delete) old messages for the users listed you could do something like the following:
1. Create an expire rule file; messagedays specifies that emails older then this are deleted - in this case 6 months e.g.
# cat /tmp/expire.rule
Rule1.regexp: 1
Rule1.folderpattern: user/.*
Rule1.messagedays: 180
2. Run the imexpire command in trial-run only using the rule file above for one of the users who you want to clean up:
./imexpire -n -v 3 -f /tmp/expire.rule -u <high quota user ID>
e.g.
./imexpire -n -v 3 -f /tmp/expire.rule -u user001@domain1.com
3. Once you are happy that the files being removed are correct and only for that single user, run the command in 'active' mode (no -n option):
./imexpire -v 3 -f /tmp/expire.rule -u <high quota user>
e.g.
./imexpire -v 3 -f /tmp/expire.rule -u user001@domain1.com
4. Run the same command for the other users who you want to clean up (delete) old emails.
Regards,
Shane.