Subject: Re: kernel-by-email
To: VaX#n8 <vax@ccwf.cc.utexas.edu>
From: Michael L. VanLoon -- HeadCandy.com <michaelv@HeadCandy.com>
List: current-users
Date: 03/08/1995 19:04:21
>1) Anyone know of a better filter program than the filter that comes with
>elm?  It doesn't make it easy to scan Cc: lines for things like current-users.

I find that, in general, MH is a more capable mail handling system
than anything else I've used.

For example, with MH:

	pick -to current-users -or -cc current-users | xargs scan

would print a summary of all articles in your current folder which are
to: or cc: current-users (case ignored).

Or, more correctly, in this case:

	pick --sender owner-current-users | xargs scan

Or, if you wanted to select them all and keep them in a selection as a
whole, put them in a sequence:

	pick --send owner-current-users -seq current-users
	show current-users

will show all the articles from current-users, and leave the selected
in the "current-users" sequence, so afterwards you could refile them
all into their own folder with a single command (folder names start
with a "+" character):

	refile current-users +current-users
               ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
                     ^              ^--folder name
                     |-----------------sequence name

If you really want to know all that MH can do, retrieve the sources
and read the numerous docs.

Just for your amusement, I have appended a /bin/sh script which takes
all the messages in my inbox, which accumulate rapidly, and refile
them all into their appropriate subfolders, sorting them and packing
out all the empty holes in the numbering sequences automagically.

     ---------- >8 ----- Begin archive-mail ----- 8< ----------
#!/bin/sh

# NetBSD lists...
LISTS="current-users port-i386 port-pmax portable-ppp source-changes tech-kern tech-net tech-ports tech-userlevel"

echo "Refiling NetBSD mail..."

for i in $LISTS; do
    echo "    $i"
    echo "        picking and refiling"
    # pick the designated messages out of the inbox and refile:
    pick +inbox --sender owner-$i | xargs refile -src +inbox +$i
    sync
    echo "        sorting"
    # sort the messages in the destination folder:
    sortm +$i
    sync
    echo "        packing"
    # pack the destination folder to get rid of holes in the ordering:
    folder -pack +$i
    sync
done

echo " "
echo "Refiling Usenet news mail replies..."

echo "    sports"

echo "        football"
echo "            picking and refiling"
pick +inbox --newsgroups '\.football' | xargs refile -src +inbox \
	+news/sports/football
sync
echo "            sorting"
sortm +news/sports/football
sync
echo "            packing"
folder -pack +news/sports/football
sync

echo "        basketball"
pick +inbox --newsgroups '\.basketball' | xargs refile -src +inbox \
	+news/sports/basketball
sync
echo "            sorting"
sortm +news/sports/basketball
sync
echo "            packing"
folder -pack +news/sports/basketball
sync

echo "        other sports"
pick +inbox --newsgroups '\.sport' | xargs refile -src +inbox +news/sports
sync
echo "            sorting"
sortm +news/sports
sync
echo "            packing"
folder -pack +news/sports
sync

echo "    ISU"
pick +inbox --newsgroups 'isu\.' | xargs refile -src +inbox +news/isu
sync
echo "            sorting"
sortm +news/isu
sync
echo "            packing"
folder -pack +news/isu
sync

echo "    comp.os.386bsd.*"
pick +inbox --newsgroups 'comp\.os.\386bsd\.' | xargs refile -src +inbox \
	+news/386bsd
sync
echo "            sorting"
sortm +news/386bsd
sync
echo "            packing"
folder -pack +news/386bsd
sync

echo "    miscellaneous news"
pick +inbox --newsgroups '.*' | xargs refile -src +inbox +news
sync
echo "            sorting"
sortm +news
sync
echo "            packing"
folder -pack +news
sync

echo " "
echo "Sorting inbox"
sortm +inbox
sync

echo "Packing inbox"
folder -pack +inbox
sync
     ---------- >8 -----  End archive-mail  ----- 8< ----------

-----------------------------------------------------------------------------
  Michael L. VanLoon                                 michaelv@HeadCandy.com
       --<  Free your mind and your machine -- NetBSD free un*x  >--
     NetBSD working ports: 386+PC, Mac, Amiga, HP300, Sun3, Sun4, PC532,
                           DEC pmax (MIPS R2k/3k), DEC/AXP (Alpha)
     NetBSD ports in progress: VAX and others...
-----------------------------------------------------------------------------