From owner-freebsd-hackers Mon Jun 10 21:43:47 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id VAA22331 for hackers-outgoing; Mon, 10 Jun 1996 21:43:47 -0700 (PDT) Received: from whizzo.transsys.com (whizzo.TransSys.COM [144.202.42.10]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id VAA22314 for ; Mon, 10 Jun 1996 21:43:42 -0700 (PDT) Received: from localhost.transsys.com (localhost.transsys.com [127.0.0.1]) by whizzo.transsys.com (8.7.5/8.7.3) with SMTP id AAA09949; Tue, 11 Jun 1996 00:43:31 -0400 (EDT) Message-Id: <199606110443.AAA09949@whizzo.transsys.com> X-Authentication-Warning: whizzo.transsys.com: Host localhost.transsys.com [127.0.0.1] didn't use HELO protocol To: "Amancio Hasty Jr." cc: hackers@FreeBSD.org From: "Louis A. Mamakos" Subject: Re: Ahhhhhhhhhh! References: <199606110052.RAA02092@rah.star-gate.com> In-reply-to: Your message of "Mon, 10 Jun 1996 17:52:44 PDT." <199606110052.RAA02092@rah.star-gate.com> Date: Tue, 11 Jun 1996 00:43:31 -0400 Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > > Well, I use > exmh + mh + glimpse + pgp 8) > If you're using MH, then you may find this perl script useful. It's both quick and dirty. It searches a specified folder for messages which have a Message-Id: header field which is a duplicate of another message previously encountered. It adds the duplicate message to the 'dups' sequence which you can then delete as 'rmm dups'. Later, when this has worked for more than a week, perhaps the script will do that as well. louie #!/usr/bin/perl # # add duplicated messages to 'dups' sequence # $ENV{'MHCONTEXT'}="/tmp/mh.$$"; chop($m = `mhpath +`); open(CTX, "<$m/context") || die "Can't open $m/context\n"; open(NEWCTX, ">$ENV{'MHCONTEXT'}") || die; while () { print NEWCTX; } close(CTX); close(NEWCTX); foreach $arg (@ARGV) { if ($arg eq "-a") { open(FLD, "folders -fast -noheader -recurse|"); while () { chop; push(@folders, $_); } close FLD; next; } if ($arg eq "-v") { $verbose++; $| = 1; next; } if ($arg eq "-l") { $list++; $verbose++; $| = 1; next; } $arg =~ s/^\+//; push(@folders, $arg); } if (!defined(@folders)) { chop($curfolder = `folder -fast`); push(@folders, $curfolder); } foreach $folder (@folders) { open(SCAN, "scan +$folder -wi 999 -format '%(msg) %<{message-id}%{message-id}%|NONE%>'|"); print "folder +$folder:" if $verbose; while() { chop; ($msg,$id) = split; next if $id =~ /NONE/; if (defined($IDS{$id})) { push(@DUPS, $msg); print "msg: $msg msgid: $id DUP of $IDS{$id}!\n"; } else { $IDS{$id} = $msg; } } close(SCAN); system "mark +$folder -seq dups -zero @DUPS"; } unlink $ENV{'MHCONTEXT'};