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.

[441 byte] By [xieliangcheng] at [2007-11-26 11:47:34]
# 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.

shane_hjorth at 2007-7-7 11:59:05 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 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?

xieliangcheng at 2007-7-7 11:59:05 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 3
It sounds like what you're asking for is message expiration, not message removal.That's actually pretty well documented: http://docs.sun.com/app/docs/doc/819-2650/6n4u4dttr?a=view
jay_plesset at 2007-7-7 11:59:05 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...
# 4
I see.# pwd/export/home0/sun/SUNWmsgsr/config# more store.expireruleNewRule.Messagedays:356NewRule.Exclusive:true
xieliangcheng at 2007-7-7 11:59:05 > top of Java-index,E-Mail, Calendar, & Collaboration,Sun Java System Messaging Server...