[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: remove old trash from imap, server side

On 30/12/05, Daniel Webb <lists@danielwebb.us> wrote:
> On Thu, Dec 29, 2005 at 02:47:29PM +0800, Chris Purves wrote:
> > I am running courier IMAP using maildirs.  I would like to know what
> > is the best way for removing mail from the trash folder that are older
> > than six months.
> >
> > Is there any functionality built into courier or should I make a cron
> > job?  What are others doing?
> Not sure how to do it with Courier.
> Another possibility if you can shut down courier in the middle of the night
> is:
> % /etc/init.d/courier stop
> % cd Maildir && find . -type f -mtime +180 -exec rm \{\} \;
> % /etc/init.d/courier start
> (test this first and understand it, because I didn't test it)
> That will get *any* file older than 180 days, so if there are non-email files
> in the tree, you'll have to get more complicated.
> Will that mess up the indices on courier, or will it just rebuild them?  I
> accidentally screwed up the indices with Dovecot and it just rebuilt them
> without a problem.
I should be able to do that quite easily with a cron job.  As for
indexing, I presently have a cron job that reports than removes spam
without stopping courier.  I haven't had any problems doing this.

Thanks for your help.  I didn't have a good way for determining the
age of the files.  Using find looks fairly straight forward.

Take care, eh.

Reply to: