home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!ames!olivea!sgigate!odin!mithras.boston.sgi.com!rc
- From: rc@mithras.boston.sgi.com (Roger Corron)
- Newsgroups: comp.mail.mh
- Subject: Fixed prune-mail script
- Message-ID: <1993Jan7.142744.15699@odin.corp.sgi.com>
- Date: 7 Jan 93 14:27:44 GMT
- Sender: news@odin.corp.sgi.com (Net News)
- Reply-To: rc@boston.sgi.com
- Organization: Silicon Graphics, Inc.
- Lines: 38
- Nntp-Posting-Host: mithras.boston.sgi.com
-
- Mail to Bob Munck (the author) bounces, and this is probably of general
- interest, so...
-
- This is a fix to the prune-mail script distributed from ftp.ics.uci.edu.
- The original could delete messages that did not have any message-id,
- such as a message filed with Fcc. If there were multiple such messages
- in a folder, one would be selected from the scan output and deleted.
- A grep for "<" and ">" solves the problem.
-
- Roger Corron
- rc@boston.sgi.com
-
- #! /bin/csh -f
- # eliminate all messages in $1 with duplicate message-ids
- #
- # Subject: MH utility to delete duplicate messages in a folder
- # Date: Wed, 19 Aug 92 11:48:45 -0400
- # From: Bob Munck <munck@Stars.Reston.Unisys.COM>
- #
- # Fixed to delete only messages with message-ids.
- # Roger Corron <rc@boston.sgi.com>
- #
- # I debated using "$1" everywhere I have "+$1", since the user
- # would then need the "+" and would be following MH conventions
- # more closely. I suppose a real convention-following utility
- # would also allow defaulting by using Path from ~/.mh-profile
- # to find context and getting Current-Folder from it.
-
- if ( ( $#argv == 0 ) || ( $1 == -help ) || ( $1 == -h ) ) then
- echo 'USAGE: prune-mail folder'
- exit 0
- endif
- folder +$1
- set s = `scan +$1 -format "%4(putnumf(msg)) %{message-id}"|grep '.*<.*>.*' | sort +1|uniq -d +5|sed 's/ .*$//'`
- if ( "$s" != "" ) then
- rmm $s +$1
- folder +$1
- endif
-