From owner-freebsd-isp Thu Oct 29 15:05:55 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA08653 for freebsd-isp-outgoing; Thu, 29 Oct 1998 15:05:55 -0800 (PST) (envelope-from owner-freebsd-isp@FreeBSD.ORG) Received: from thor.afnetinc.com (thor.afnetinc.com [206.40.232.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA08648 for ; Thu, 29 Oct 1998 15:05:52 -0800 (PST) (envelope-from efinley@efinley.com) Received: from pm3-0-ip4.afnetinc.com ([206.40.232.83]) by thor.afnetinc.com with smtp (Exim 2.05 #1) id 0zZ17z-0005d0-00; Thu, 29 Oct 1998 16:05:16 -0700 From: efinley@efinley.com (Elliot Finley) To: dannyman Cc: Scott Lambert , freebsd-isp@FreeBSD.ORG Subject: Re: Expiring old mail? Date: Thu, 29 Oct 1998 23:06:00 GMT Organization: Hiawatha Coal Company Reply-To: efinley@efinley.com Message-ID: <363af4a4.6564902@mail.afnetinc.com> References: <19981026185229.A386@csw.net> <19981029151229.Y8390@enteract.com> In-Reply-To: <19981029151229.Y8390@enteract.com> X-Mailer: Forte Agent 1.5/32.451 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.freebsd.org id PAA08649 Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I have a perl script that I run once per day that goes through all the mailboxes and removes all messages that are older than 60 days, whether they've been read or not. On Thu, 29 Oct 1998 15:12:29 -0600, you wrote: >On Mon, Oct 26, 1998 at 06:52:29PM -0600, Scott Lambert wrote: >> Hi, >> >> I recently ran into a problem with my mail server. The /var/mail disk filled >> up. (not good) >> >> Anyway after several hours of "mail -f username" and deleting 7 month-old un- >> read messages and > 1 month-old read messages, I freed up approximately 700MB >> of disk. (Why do people subscribe to every mailing list on the planet and >> not read their mail?) > >Heh, I have a little script I used to use for just this sort of situation, >which would write a script to move the largest spools into user home >directories. > >#!/bin/sh >echo "#!/bin/sh" > movemail >rm /home/`whoami`/mail-abusers >ls -ulsk /var/mail | sort -rn | head -25 | awk '$4==$10 { print "\n#"$4" size "$6" last mod "$8" "$7" "$9"\nmv /var/mail/"$4" /home/"$4"/INBOX\nchown "$4" /home/"$4"/INBOX\necho -n \""$4", \" >> /home/djhoward/mail-abusers" }' >> movemail >#echo "rm movemail" >> movemail >chmod 755 movemail >$EDITOR movemail >echo "Okay, now you can sudo ./movemail at your discretion." > >Not the cleanest or prettiest script, by any means, but that fouth line always >gave me a warm fuzzy feeling. > >HTH, >danny -- Later Science (efinley@efinley.com) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message