Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

up vote 5 down vote accepted

Yes

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: dovecot.org/list/dovecot/2009-July/040896.html –  Andrew B Jan 10 '13 at 22:34

Your Answer

 
discard

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.