How to empty LARGE mailbox?

Nautic

Verified User
Joined
Jun 17, 2008
Messages
46
Hi, doing a server move and 1 of my mailboxes I just spotted is insanely large (estimate about 6gb). However I can't use DA to empty it, when I select the mailbox and click "purge" from the inbox it just waits, then hangs.

It is the main catchall email of one of the accounts.

Is there a way from CLI or another way to dump all emails in that inbox?
 
cd /home/username/imap/domain.com/emailname/Maildir

find ./cur -type f -delete
find ./new -type f -delete

Replace username, domain.com and emailname with actual values.

username = da login
domain.com = domain name
emailname = preceeding email name ex. [email protected] would be bob
 
Last edited:
Hi scsi,

Thanks for the reply, unfortunately it didn't work.

cd /home/username/imap/domain.com/emailname/Maildir had no email accounts.

However /home/domain.com/Maildir/new is 4.0gb

I'm thinking...

rm -rf new/* should clean it out?
 
Cautionary note; when removing email manually you should remove the Dovecot index files as well; they'll be recreated the next time someone logs into the mailbox.

And you should not use catchall email. Hopefully you've figured that out by now :).

Jeff
 
Back
Top