How to used command to delete all user' s mails
1. I want to delete all user's mails between one time. Example delete all user's mails before 2006-11-10,
2. I want to delete all user's mails between one time to time.
(example: delete all user's mails between 2005-11-10 to 2006-05-13)
3. I want to delete somebody's all mails (but don't delete the INBOX folder)
4.I want to delete somebody's mail before 2006-01-28
How to used command to do it.
# 1
Hi,
Please specify whether you want to delete email that was delivered to the mailbox before 2006-11-10 OR whether you want to delete email with a Date: header before 2006-11-10. These are not the same thing.
If it is the former, you can delete these emails by running a 'find' with the appropriate switches to locate all the .msg files older then a certain date and remove them from the account. Then a reconstruct will fix up the indexes so only the messages you want will be left.
If you want to delete whole folders, you can do that by using the mboxutil -d command. e.g. mboxutil -d user/uid/Sent
If the user has a large number of folders, you could process the output of mboxutil -lp 'user/uid/*' to get a list of folders into a <file> then use this file with mboxutil -d -f <file> (don't include the INBOX folder of course).
Regards,
Shane.
# 2
Thanks shane_hjorth.
I know delete somebody mails
# ./mboxutil -d user/uicname/Drafts
# ./mboxutil -d user/uicname/INBOX
Remove message that have been in the folder longer than specified umber of days
e.g: delete 120 day's message.
In CGI interface have this function " Automatic Message Removeal Policy"> "expire rule entry",
But command how to do this?