Well, I dug dipper and found ipurge...

This is exactly the tool I was looking for, does a good job for me.

Besides - I wonder how long will reconstruct on a 400K msgs folder...

Regards,

D.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael Sims
Sent: Monday, November 29, 2004 5:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Selective delete

Dudi Goldenberg wrote:
> Is there a way to delete all messages in a specific (or all?) IMAP
> folders older then a specified number of days?
>
> I have a customer that holds ~50-500K msgs per folder.... An scheduled
> cleanup sounds like a good idea here ;-)
>
> Running Cyrus v2.1.7 on Debian Sarge.

I'm sure this isn't the recommended way to do it, but you could delete
the message
files then run reconstruct on the user's mailbox (after making a backup,
of course).
cd to the user's spool directory and run this:

# find -type f -name '[0-9]*.' -mtime +365

That should give you a list of which messages are older than a year
(adjust to
desired value).  If it looks right then this should do the trick:

# find -type f -name '[0-9]*.' -mtime +365 -print0 | xargs -0 rm

Now run reconstuct on the user's mailbox and then rebuild the quota
files and you
should be set.

Maybe someone else can suggest a way to do this through IMAP so you
don't have to
get behind Cyrus's interface...

HTH

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

Reply via email to