Fixing Large Inboxes
From Kyle's Wiki
Sometimes imap inboxes get huge and you need to clean it up into seperate folders:
#first get into the "cur" directory where it is full find . -type f -ctime +168 | wc # This will show you all files older than 1 week
Lets make a folder called Archive and put them in there
cd .. ls -a1 mkdir .Archive mkdir .Archive/cur mkdir .Archive/new mkdir .Archive/tmp #you may need to change permissions chown -R vpostmaster:vpostmaster .Archive ls -l .Archive/ chmod -R 700 .Archive ls -l .Archive/
Now Let us move back to the cur directory and move those files!
cd ../cur/ find . -type f -ctime +168 -print0 | xargs -0 -i'{}' mv '{}' ../.Archive/cur/ ls -1 | wc -l