home *** CD-ROM | disk | FTP | other *** search
- ; UNIX-From: kaul@icarus.eng.ohio-state.edu Thu Jul 5 22:51:15 1990
- ; Received: from icarus.eng.ohio-state.edu by cheops.cis.ohio-state.edu (5.61-kk/5.900605)
- ; id AA00420; Thu, 5 Jul 90 22:51:15 -0400
- ; Received: by icarus.eng.ohio-state.edu (4.1/2.890910)
- ; id AA05335; Thu, 5 Jul 90 22:51:10 EDT
- ; Date: Thu, 5 Jul 90 22:51:10 EDT
- ; From: kaul@icarus.eng.ohio-state.edu (Rich Kaul)
- ; Subject: GNUS mail reading.
- ;
- ; Although I don't get as large a quantity of mail as you do, I still
- ; get a fair bit of mail. As such, I have been looking into GNUS as a
- ; mail reader and have found I like it. Because we don't have the
- ; source to a recent version of cshe around here and because I would
- ; rather have something a bit more portable for future reference I
- ; changed the pmd and make-active shell scripts you made into Bourne
- ; shell scripts. Perhaps I should have made them bash scripts (it would
- ; have been easier), but they're sh scripts and they seem to work, at
- ; least on a Sun 3 running SunOS 4.0.3. I did try and keep them as
- ; generic as possible, however. I thought you might like them as a
- ; reference and porting base for others so I'm passing them along.
- ;
- ; I did make some changes in the scripts, however. For example, the pmd
- ; script has a delivery function that decides whether the message
- ; destination is a directory, in which case it does the appropriate
- ; manipulations for GNUS reading, or a file, in which case it does the
- ; appropriate work for mail reading. It's one of the key ways in which
- ; I filter my incoming mail. As you can see from looking at it, there
- ; is only a small group of people who are able to send mail in
- ; /usr/spool/mail/kaul so only mail from that group of people is able to
- ; interrupt my working activity (advisors can be rather demanding about
- ; getting something done *now* so that their work can get out and people
- ; working for you also tend to have questions that need quick
- ; turn-around). Further, the use of the key files is rather different
- ; than it was in your pmd, but that's a minor implementation difference.
- ;
- ; Comments are appreciated if you have any. I'm glad that all I had to
- ; do was change some of the structure and logic of these and not write
- ; them from scratch.
- ;
- ; -rich
- ;
- ; #! /bin/sh
- ; # This is a shell archive. Remove anything before this line, then unpack
- ; # it by saving it into a file and typing "sh file". To overwrite existing
- ; # files, type "sh file -c". You can also feed this as standard input via
- ; # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- ; # will see the following message at the end:
- ; # "End of archive 1 (of 1)."
- ; # Contents: make-active pmd
- ; # Wrapped by kaul@icarus.eng.ohio-state.edu on Thu Jul 5 22:39:58 1990
- ; PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- ; if test -f 'make-active' -a "${1}" != "-c" ; then
- ; echo shar: Will not clobber existing file \"'make-active'\"
- ; else
- ; echo shar: Extracting \"'make-active'\" \(819 characters\)
- ; sed "s/^X//" >'make-active' <<'END_OF_FILE'
- ; X#!/bin/sh
- ; X#
- ; X# Script to generate an active file for GNUS mail reading for Rich Kaul.
- ; X# Builds a shadow active file which represents personal mail under
- ; X# $1 plus a symlinks to the real news area.
- ; X
- ; Xdir=$1
- ; Xshift
- ; Xactive=$dir/active
- ; Xnactive=/usr/lib/news/active
- ; Xif [ $#argv -lt 1 ]; then
- ; X echo make-active: usage: make-active directory subdirs...
- ; X exit 87
- ; Xfi
- ; X
- ; X# Find directories and their associated .first and .last files. Then
- ; X# take base dirnames, change to newsgroup name format, and build the
- ; X# mail-based active file out of it all.
- ; X
- ; Xcd $dir
- ; Xlist=$*
- ; Xcp /dev/null $active
- ; Xfor i in $list ; do
- ; X first=`cat $i/.first`
- ; X first=${first:=0}
- ; X last=`cat $i/.last`
- ; X last=${last:=0}
- ; X nlist=`echo $i | tr / .`
- ; X echo $nlist $last $first n >> $active
- ; Xdone
- ; X
- ; X# Now add the whole canonical active file,
- ; Xcat $nactive >> $active
- ; X
- ; Xexit 0
- ; END_OF_FILE
- ; if test 819 -ne `wc -c <'make-active'`; then
- ; echo shar: \"'make-active'\" unpacked with wrong size!
- ; fi
- ; chmod +x 'make-active'
- ; # end of 'make-active'
- ; fi
- ; if test -f 'pmd' -a "${1}" != "-c" ; then
- ; echo shar: Will not clobber existing file \"'pmd'\"
- ; else
- ; echo shar: Extracting \"'pmd'\" \(1672 characters\)
- ; sed "s/^X//" >'pmd' <<'END_OF_FILE'
- ; X#!/bin/sh
- ; X#
- ; X# Personal mail delivery for Rich Kaul. This version can use the GNUS
- ; X# news reader to read mail as if it were news, although that is not
- ; X# required. I also have it set up so that only a few people can send
- ; X# me mail that will alert me to its arrival by depositing itself in
- ; X# /usr/spool/mail/kaul.
- ; X
- ; Xumask 077
- ; XPATH=/usr/local/bin:/usr/ucb:/bin:/usr/bin
- ; Xmail_dir=/usr/1/kaul/mail
- ; Xnews_dir=/usr/1/kaul/Memos/personal
- ; Xmailbox=/usr/spool/mail/kaul
- ; Xtmp=/usr/1/kaul/mail/kaul-$$
- ; X
- ; Xdeliver()
- ; X{
- ; X keyf=$*.KEY
- ; X retry=0
- ; X while [ $retry -lt 20 -a -f $keyf ]
- ; X do
- ; X echo "Retry number $retry"
- ; X sleep 10
- ; X retry=`expr $retry + 1`
- ; X done
- ; X
- ; X # If we fall out to here without success, we failed 20 times to
- ; X # get the key. Result: Who cares? We'll go forward anyway,
- ; X # and re-assert the key when we're done.
- ; X touch $keyf
- ; X if [ -d $* ]; then
- ; X seq=`cat $*/.last`
- ; X seq=`expr $seq + 1`
- ; X echo $seq > $*/.last
- ; X sed -e '1s/^From /UNIX-From: /' < $tmp > $*/$seq
- ; X else
- ; X if [ -s $* ]; then
- ; X echo '' >> $*
- ; X fi
- ; X sed -e '1s/^From: /From /' < $tmp >> $*
- ; X fi
- ; X rm -f $keyf
- ; X}
- ; X
- ; X
- ; X# Save the mail momentarily so we can work on it.
- ; Xcat - > $tmp
- ; X
- ; X# Deduce headers appropriately.
- ; Xfrom=`head -1 $tmp`
- ; X
- ; Xfrom=`echo "$from[2]" | sed -e 's/@.*//' -e 's/\(.*\)!\(.*\)/\2/'`
- ; Xcase $from in
- ; X *[Ff][Ii][Rr][Ee][Aa][Rr][Mm][Ss]*)
- ; X deliver $news_dir/firearms
- ; X ;;
- ; X *[Hh][Vv][Rr]*)
- ; X deliver $news_dir/xview
- ; X ;;
- ; X *[Ff][Rr][Ee][Ee][Mm][Aa][Cc][Ss]*)
- ; X deliver $news_dir/freemacs
- ; X ;;
- ; X bibyk | ken | monty | joe | wilson | orlando | gratz | zaka )
- ; X deliver $mailbox
- ; X ;;
- ; X *)
- ; X deliver $news_dir
- ; X ;;
- ; Xesac
- ; X
- ; X# Clean up and exit
- ; Xrm -f $tmp
- ; Xexit 0
- ; END_OF_FILE
- ; if test 1672 -ne `wc -c <'pmd'`; then
- ; echo shar: \"'pmd'\" unpacked with wrong size!
- ; fi
- ; chmod +x 'pmd'
- ; # end of 'pmd'
- ; fi
- ; echo shar: End of archive 1 \(of 1\).
- ; cp /dev/null ark1isdone
- ; MISSING=""
- ; for I in 1 ; do
- ; if test ! -f ark${I}isdone ; then
- ; MISSING="${MISSING} ${I}"
- ; fi
- ; done
- ; if test "${MISSING}" = "" ; then
- ; echo You have the archive.
- ; rm -f ark[1-9]isdone
- ; else
- ; echo You still need to unpack the following archives:
- ; echo " " ${MISSING}
- ; fi
- ; ## End of shell archive.
- ; exit 0
- ;
- ;