>> Does anyone know of any Perl modules for manipulating files in the
>> archive2 format? Not for rewriting, just for processing message by
>> message and noting lengths and lseek offsets for each..
>
>Since they are just mbox folders, try CPAN for MailFolder and maybe
>MailTools.
There should be loads of stuff to do this in perl as hinted. There's also
purgmbox which will be in C. The following were posted to a mailing list
some time ago:
>About a week ago, someone asked about a tool to edit user
>mailboxes. I noted I had a tool that did this with an eye
>to imposing a limit on user mailboxes, and volunteered to
>send the program and/or source code to those who asked.
>Little did I know what would happen to my inbox!
>
>I've cleaned up the source a bit, written a small man page
>and package-aware makefile, and posted the FreeBSD package
>and matching source in:
> <ftp://ftp.us.net/pub/unix/freebsd/purgmbox-1.0.tgz>
> <ftp://ftp.us.net/pub/unix/freebsd/purgmbox-1.0src.tgz>
>The package is linked with /usr/lib/compat, so it should
>work on both 2.2.x and 2.1.x systems.
>
>This uses flock(2) on the mailbox; I don't know if it's
>needed, but I'd rather have more than less. Please let
>me know if this bites you.
AND
>$ 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();
Both from:
>John Woodruff, Sr. Network Engineer, US Net - 301-572-5926
>Washington/Baltimore/Richmond ISP - $6.95/month for full PPP!
I'd check out the mailing list archives on www.freebsd.org if you wanted
his email address ...
References:
|
|