Delete all mail users data

4 posts / 0 new
Last post
#1 Mon, 10/20/2008 - 02:38
rpereyra

Delete all mail users data

Hi

Please I would like to delete all users date mail (not accounts) in my virtualmin box.

I using Centos 5 and the default install (default install script).

Once I erased simply the files in the maildir folders and broke the dovecot setup (dovecot cache).

Which is the correct way of doing it?

Thanks in advance.

roberto

Mon, 10/20/2008 - 11:34
Joe
Joe's picture

Also delete the dovecot cache/index files. ;-)

Dovecot will regenerate its cache files automatically on next login by the user.

--

Check out the forum guidelines!

Thu, 10/23/2008 - 01:30 (Reply to #2)
rpereyra

Thanks for your help, I delete the mail data using:

find /home -type f -mtime $days | xargs rm

This would remove everything over $days days old.

That's remove the dovecot files also.

roberto

Thu, 10/23/2008 - 05:30 (Reply to #3)
andreychek

Careful with that command -- that won't just delete email, that will delete all user files in /home older than $days.

You may want to have it be more specific about what directories to delete email from -- for example, all the email exists in a directory called "Maildir", you could make sure you're only deleting files from within that.
-Eric

Topic locked