They discussed something similar to this on the list a week or so ago. For users who are on the same server as the mail host, apparently you can snag the monthly archive direct from the server. I guess MajorDomo and Listproc have some sort of monthly archive option.
If you're not on the mail server, you could either send an email request for the monthly archive on a regular basis, or break it out by month as it arrives every day. That's what I have to do.
I run this script every night. It uses the the non-existence of a monthly directory to trigger it's creation and the erasure of the mail file (containing last month's mail). It also reindexes the entire archive.
#!/usr/local/bin/perl # # HYPERCRON - Hypermail Cron Job # May 1998 # by Charles Hall # # Update the appropriate directory (i.e. "1998/May") with the mailboxcontents
_at_mon = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec);
# Today's date.
_at_now = localtime(time);
$month = $mon[$now[4]];
$year = $now[5] + 1900;
# At start of a new month, create new directory and # send last messages to previous month.
if (! -e "$home/$year/$month") {
`mkdir -p "$home/$year/$month"`; if ($month eq "Jan") { $month = "Dec"; $year--; } else { $month = $mon[$now[4]-1]; } $flag = 1;
_at_lp = `/usr/local/bin/hypermail -m $mbox -d $home/$year/$month -a
"/baidarka" 2>&1`;
print "hypermail -m $mbox -d $home/$year/$month -a /baidarka\n";
print _at_lp;
# _at_lp = `/usr/local/bin/swish -c /usr/local/Swish/baidarka.conf 2>&1`; # print "swish -c /usr/local/Swish/baidarka.conf\n"; # print _at_lp;
_at_lp = `/httpd/htdocs/baidarka/wgreindex -q 2>&1`; print "/httpd/htdocs/wgreindex -q\n"; print _at_lp;
# Blank out last months accumulated mail.
if ($flag) {
# Can't unlink because of /var/spool/mail permissions, just open and
close.
open(X,">$mbox") || die "Couldn't open $mbox: $!\n"; close(X);
-- Charles Hall Total Sports Raleigh, NC USA http://info.totalsports.netReceived on Mon 14 Sep 1998 05:24:52 PM GMT
This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:11 AM GMT GMT