Date: Sun, 17 Sep 2000 23:54:44 -0700 From: dannyman <dannyman@dannyland.org> To: David Drum <david@mu.org> Cc: freebsd-isp@freebsd.org Subject: Re: Mail box trimming tool Message-ID: <20000917235444.A30479@dell.dannyland.org> In-Reply-To: <20000917174029.A94914@elvis.mu.org>; from david@mu.org on Sun, Sep 17, 2000 at 05:40:29PM -0500 References: <200009151707.NAA32297@eviloverlord.org> <20000917174029.A94914@elvis.mu.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Sep 17, 2000 at 05:40:29PM -0500, David Drum wrote: > Quoth Matt Goward: > > > Does anyone know of a tool that given a username and quota, will trim a > > mail box by deleting the oldest message until it is at the quota? > > Based on some statistics I generated for the 60,000-plus mailboxes I > am responsible for, the median size is usually very small (under 1KB) > but the standard deviation is very large (around 1.5MB). So I don't know > that expiring based on a space quota is appropriate, since mailbox sizes > vary greatly. We expire messages that are over 14 days old (based on > the headers). I've attached the script we use. I have a web site that harvests pictures off of USENET a a constant rate. Since I have finite storagespace, I of course have an expire script. It deletes files that are the oldest, with the catch that I subtract the file size from the seconds since epoch. a 1M file would be deleted about 10 days before a 100k file, for example. (if my math is right.) An algorithm like this is trivial to implement if your mail storage is Maildir, is why I think of it. Even so, if you're going through the pain of parsing mbox, it's a pretty simple sort of calculation to make. Of course, it might be truly clever to replace a large MIME attachment with a note saying it has been triaged out to save your quota, rather than deleting a message, but I digress. :) -d -- dannyman - http://www.dannyland.org/~dannyman/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000917235444.A30479>