From owner-freebsd-isp Tue Apr 14 20:35:07 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA04879 for freebsd-isp-outgoing; Tue, 14 Apr 1998 20:35:07 -0700 (PDT) (envelope-from owner-freebsd-isp@FreeBSD.ORG) Received: from home.us.net (home.us.net [198.240.72.28]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id DAA04874 for ; Wed, 15 Apr 1998 03:35:04 GMT (envelope-from jjw@us.net) Received: from q.jjw.us.net (q.jjw.us.net [207.244.202.2]) by home.us.net (8.8.8/8.8.8) with SMTP id XAA25685; Tue, 14 Apr 1998 23:34:48 -0400 (EDT) X-Provider: US Net - Advanced Internet Services - (301) 572-5926 - info@us.net Where Business Connects! (tm) -- http://www.us.net/ Message-ID: <35341C79.2781E494@us.net> Date: Tue, 14 Apr 1998 22:33:29 -0400 From: John Woodruff Organization: US Net X-Mailer: Mozilla 3.01Gold (X11; I; FreeBSD 2.2.5-RELEASE i386) MIME-Version: 1.0 To: Oliver von Bueren CC: isp@FreeBSD.ORG Subject: Re: User Mailbox Maintenance References: <3536b759.106395728@mail.ovb.ch> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Oliver von Bueren wrote: > Has anybody a tool for maintaining user mailboxes which become too > big? Something like: Delete everything thats older than... > Should be configurable to select which mailboxes to work on and how > long of course. A while back I wrote a C program to do that: $ purgmbox ? Purpose: Purge old mail items from Unix mailbox files Usage: purgmbox [-opts] mbox ... -fname - Purge messages From name -lfile - Log messages to 'file' -onn - Purge messages older than nn days -snn - Purge until mailbox smaller than nn kbytes -v ... - Verbose; Print summary. Repeat for more detail mbox - One or more mailbox files Members of the same login group may purge each other's mailboxes. It can (but doesn't have to be) installed set-gid mail; and if so is real careful. That last feature can be #defined away. It's a single pass. Designed to be called from cron as: find /var/mail -type f | xargs purgmbox -o90 -s512 It was a piece of a larger system, so has an extra function or two to handle more logging than usually done (-l flag). Oritinally written for HP-UX 9.x, I think; needs SysV-style postmarks on mail items; does lockf(); needs mktime(); Mail me if someone wants the source and/or FreeBSD package. -- John Woodruff, Sr. Network Engineer, US Net - 301-572-5926 Washington/Baltimore/Richmond ISP - $6.95/month for full PPP! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message