Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Apr 1998 22:33:29 -0400
From:      John Woodruff <jjw@us.net>
To:        Oliver von Bueren <ovb@ovb.ch>
Cc:        isp@FreeBSD.ORG
Subject:   Re: User Mailbox Maintenance
Message-ID:  <35341C79.2781E494@us.net>
References:  <3536b759.106395728@mail.ovb.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?35341C79.2781E494>