This may be a pure management issue, but in my experience this kind of decision devolves to the sysadmin staff to justify and enforce all too often. Because of this, it is my job as the sysadmin to convince management that there is a problem here and it should be taken seriously, and to posit management mechanisms that may be useful.
One of my old employers had a GroupWise system, which at the time didn't have any quota mechanisms in it (this was a while ago, GW has had it for some time now). So ultimately we resorted to a peer-pressure method. Each month we'd print off a report of the $X largest mail-boxes in each department and send the reports off to the office-managers. Within two months the top-5 list of largest mailboxes had a much smaller average size.
Some methods I've found useful for convincing management to pay attention to this issue:
Define the cost of mail storage
If you're getting the "but Google does it" pushback, start building spread-sheets that show how much mail costs. Managers understand cost. You, or the people you buy things through, have the costs for your server hardware, software, AV software, and other related costs. From this you can assign a dollars-per-MB number for mail storage. This allows you to give a decently good dollar value for a 3GB mailbox versus a 200MB mailbox.
This, by the way, is why you learned algebra back in school.
This can go one of three ways:
- They increase their mail-storage spend. They see the numbers, realized they're under-investing, and throw money at it to get to where you "should" be.
- They agree to provide downward pressure on mail growth in order to better control this cost.
- They say %*&!@ it! To the cloud!
Produce mail system upgrade costs
If the above is beyond your mad spreadsheeting skills, producing upgrade plans for keeping ahead of your storage consumption curve is a good way to at least get the conversation started. When they see bigbigmoney for upgrades, they'll ask why. And then you'll tell them. When they ask how they can avoid this cost, mention providing downward pressure on the big mail users.
I've done both of the above to justify simple storage purchases. The same techniques work for email, where you've got an entire application stack sitting on top of your storage/backup infrastructures. Dollars (or currency-of-choice) per unit is a great method of highlighting costs and the perils of overindulgence. Sometimes it can cause very significant strategic changes (see also, to the cloud!). Sometimes it can jar loose resources.
Politically speaking, it's a good idea to provide some suggestions for how to provide downward pressure for email consumption. But that's all they are, suggestions to the management who has to actually implement them or convince other managers to do so.
Best Answer
You can specify a range of messages
start:end
in place of the single message number (179
in your example); useSEARCH ALL
to find out the valid message number range.Note, this is assuming you can use raw IMAP, which can be painful to impossible if it is (as it should be) using
AUTHENTICATE
instead ofLOGIN
.. You may prefer to find an IMAP toolkit of some kind (note that Cyrusimapd
comes with Perl libraries that can be used to script logging in and performing various operations, although you will need to have some familiarity with RFC 2060.