Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use dovecot IMAP server and want to delete big unneeded mails:

cd /var/spool/foouser; du -a | sort -rn > /var/tmp/du-mail-foouser.log

Now I see big mails at the top and after looking at them I want to remove them.

Is it safe to just call

"rm ./foofolder/1318412893.M857530P4656.hz1,W=14463815,S=14268320:2,S"?

share|improve this question
up vote 7 down vote accepted


In this particular case, you are using a 'Maildir' format mailbox. In Maildir, it's safe to use 'rm' to remove an individual piece of email, to use 'mv' to move an individual mail between folders on the same file system, etc.

With other mail storage types, it may not be safe to rm a single email.

More about Maildir:

share|improve this answer
And while dovecot does maintain its own internal indexes, it looks like it will end up rebuilding them for you: – Andrew B Jan 10 '13 at 22:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.