cleaning out trash bins

wondering if there is some program out there to help clean out trash bins....

I've been running this command to get a list of trash bins sorted by size:

du -sk */Maildir/.INBOX.Trash/cur | sort -n

then manually changing to each box...

cd kathryn/Maildir/.INBOX.Trash/cur

and using rm *

I'm just thinking there must be a better way... Most of our users (800 of them) use Squirrelmail so there is no auto-clean function.



Howdy -- there's a Usermin option to automatically empty the trash... but that means you'd need to log into Usermin and enable that.

If you're using Squirrelmail, you could always try this "Empty Trash" plugin:

I hadn't used that, but that might be a good place to start.

I'll give that a try. One problem with this approach is that when I do a virtualmin restore to a new server, it changes the trash folder, eg. .trash to INBOX.Trash. so there are all these extra folders. Am I doing something wrong in my restoration?

Are you just seeing new empty folders being created? Or are you seeing an existing folder being renamed?

new empty folders being created

If you go into System Settings -> Virtualmin Config -> Actions upon server and user creation, all the way at the bottom are some options regarding email folders. In there, you can disable the creation of them altogether, which it sounds like you may want.