I have been using the O'Reilly book "Managing Mailing Lists" to help me
set up a SmartList mailing list. Within the book, the section on
archives shows a perl script to save messages in an archive organized in
"/archive/YYMM/DD" format.
I typed the script in and have found it to work just fine with the
exception of what looks like a Y2K bug. Instead of creating a YYMM
directory having a name of "0008" it creates one with the name of
"10008". I think this means it calculates the year as being 100, which
is one more than 99 (1999). I have included the script in this email.
Any ideas in correcting this problem? Thank you
(arch_trunc script replacement from O'Reilly & Associates Managing
Mailing Lists)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
#!/usr/bin/perl
#
# arch_trunc, a replacement for the distributed ./bin/arch_trunc
# shell script in SmartList. To use it, put it in some list's
directory.
#
# By Alan Schwartz
#
# This script is run whenever a submission is received and archived
# in archive/latest. It's responsible for cleaning up that directory.
# This version figures out the date of each file in archive/latest
# that should be removed and appends it to the file archive/YYMM/DD
#
unless (chdir("archive/latest")) {
print "Don't start this script directly, it is called by
rc.request\n";
exit 64
}
# Only do the removing now and then to keep load down
#if ($ENV{'ARCHIVE'} =~ /[248]$/) {
opendir(DIR,".");
@files = grep(/^\d+/,readdir(DIR));
closedir (DIR);
foreach (sort bytime @files) {
$recent++;
if ($recent > $ENV{'archive_hist'}) {
# Archive these and delete them
@time = localtime((stat($_))[9]);
$newdir = sprintf("%02d%02d",$time[5],$time[4]+1);
$newfile = sprintf("%02d",$time[3]);
unless (-d "../$newdir") {
mkdir("../$newdir",2770);
}
open(IN,$_);
open(OUT,">>../$newdir/$newfile");
print OUT <IN>;
close(IN);
close(OUT);
unlink($_);
}
}
unlink("_dummy_");
#}
sub bytime {
return -M $a <=> -M $b;
}
-----------------------------------------------------------------------------------------------------------------------
--
_________________________________________
Dave G. Bacon
Computer Network Manager
Outagamie Waupaca Library System
225 N. Oneida St., Appleton, WI 54911
920/832-6193(voice), 920/832-6422(FAX)
dbacon(a)mail.owls.lib.wi.us
_________________________________________
>> Quoting "David R. Linn" <drl(a)vuse.vanderbilt.edu>:
>>
>> > Yes, paritcularly when all that was needed was a trivial change to
>> > the list config.
>>
>> Since YEARS list members complained about this, sending emails to
>> Stephen and the list without any reaction of a responsible person.
Unfortunately, SRB has been otherwise occupied for a while and a plan
to turn the procmail and SmartList machines over to a team never got
off the ground. (I was a member of that team) For that matter, neither
did a plan to move the lists to procmail.org and smartlist.org.
>> Now suddenly someone made a decision without asking the list members.
>>
>> This list owns the list members not someone at an university who wants
>> to be a big list master!
My perception is that the change was a result of the sudden decommisioning
of the machine on which the list was running. (I have faced such a need
in the past; when a machine is compromised, it needs to be off the net
**NOW**.) So, the choice is not so much between SmartList and Mailman
as it is between Mailman and *nothingness*, i.e. the list would have been
abruptly discontinued.
>> Such an behaviour is disappointing and doesn't encourage anybody
>> continuing to support SmartList/Procmail.
Personally, I thanked the RWTH staff for making the extra effort to keep
the list alive when they could have let it die silently.
>> If the SmartList-Package-Maintainer agree to point to another list
>> server for SmartList we could simply set up one very quickly (with
>> searchable (web) archive ....) running with SL.
I personally believe we need to revive the plan to move the lists to
procmail.org and smartlist.org.
>> I don't like to remember a password to unsubscribe and I don't like such
>> a "list dictatorship"!
At least we still have a list on which to discuss this.
>> Werner
David
--
David R. Linn, SEDCON System Manager |INET: drl(a)vuse.vanderbilt.edu
Vanderbilt University School of Engineering|Phone: [+1] 615-343-6164
Box 1826, Station B |Disclaimer: I have no authority
Nashville, TN, USA 37235 |to speak for anyone but myself.
The 2nd millenium and 20th century do not end before December 31, 2000.
http://www.vuse.vanderbilt.edu/~drl
Another X-Command question. Well there have been some pretty harsh words
recently about the idocy of anyone not getting the how-to of the X-Command
feature, so admittedly, I'm reluctant to ask anything here, but I've been
trying this off-and-on now for a number of months with no success. I've
read and re-read the famous *Chapter 2*, reviewed the mailing list
archives, prayed to God for enlightenment, and been up and down through the
comments in most of the rc files and examples. Still... no luck.
I'll admit: I am missing something obvious, easy, and I'm stupid for not
seeing it. And now that I've said it myself, I don't need anyone else to
state the obvious, but I would appreciate a helping hand in getting this to
work.
Okay, so I send a non-HTML e-mail from the administrator's account with no
subject line to the list-request address. The first line of the body is:
X-Command: faxguy(a)deanox.com password showdist
And I send it. And the dist list surely doesn't show up in response.
Regardless of the command, I get the same response: nothing. I've turned
on VERBOSE and LOGEXTRACT, and it looks like the x-command is being
processed, but something is killing it... my log follows.
Thanks.
Lee Howard
procmail: [6262] Thu Aug 3 01:25:42 2000
procmail: Assigning "RC_CUSTOM"
procmail: Assigning "INCLUDERC="
procmail: Assigning "LOCKFILE=tmp.lock"
procmail: Locking "tmp.lock"
procmail: Match on "^^X-Command:"
procmail: Executing "formail,-X,"
procmail: Match on "< 4096"
procmail: Match on ""
procmail: No match on ! "^(X-(Loop:
()testing@deanox\.com|Diagnostic:)|X-Command:)"
procmail: Assigning "LOGABSTRACT=yes"
procmail: No match on ! "^(Subject:(.*[^a-z])?Re:|X-(Loop:
()testing@deanox\.com|Diagnostic:)|X-Command:)"
procmail: Match on "^X-Command:.*()[ ]*()password"
procmail: Match on ! "^X-Loop: ()testing(a)deanox\.com"
procmail: Locking "dist.lock"
procmail: Executing "x_command"
procmail: Unlocking "dist.lock"
procmail: Assigning "LOCKFILE"
procmail: Unlocking "tmp.lock"
procmail: No match on ! "< 524288"
procmail: No match on "(^(Mailing-List:|Precedence:.*(junk|bulk|list)|To:
Multiple recipients of |(((Resent-)?(From|Sender)|X-Envelope-From):|>?From
)([^>]*[^(.%@a-z0-9])?(Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|
m(mdf|ajordomo)|n?uucp|LIST(SERV|proc)|NETSERV|o(wner|ps)|r(e(quest|sponse)|
oot)|b(ounce|bs\.smtp)|echo|mirror|s(erv(ices?|er)|mtp(error)?|ystem)|A(dmin
(istrator)?|MMGR|utoanswer))(([^).!:a-z0-9][-_a-z0-9]*)?[%@>
][^<)]*(\(.*\).*)?)?$([^>]|$)))"
procmail: No match on "^X-Loop: ()testing(a)deanox\.com"
procmail: No match on ! "^X-(Diagnostic|Processed):"
procmail: Assigning "INCLUDERC="
procmail: No match on ! "^X-(Diagnostic|Processed):"
procmail: Executing "formail,-AX-Envelope-To: testing-request"
procmail: Match on ! "."
procmail: Locking "request.lock"
procmail: Assigning "LASTFOLDER=request"
procmail: Opening "request"
procmail: Acquiring kernel-lock
procmail: Unlocking "request.lock"
>From redder(a)deanox.com Thu Aug 3 01:25:42 2000
Subject:
Folder: request 794