home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / elisp / patches / gnus-mail-mods.shar < prev    next >
Encoding:
Text File  |  1991-05-03  |  6.7 KB  |  202 lines

  1. ; UNIX-From: kaul@icarus.eng.ohio-state.edu  Thu Jul  5 22:51:15 1990
  2. ; Received: from icarus.eng.ohio-state.edu by cheops.cis.ohio-state.edu (5.61-kk/5.900605)
  3. ;     id AA00420; Thu, 5 Jul 90 22:51:15 -0400
  4. ; Received: by icarus.eng.ohio-state.edu (4.1/2.890910)
  5. ;     id AA05335; Thu, 5 Jul 90 22:51:10 EDT
  6. ; Date: Thu, 5 Jul 90 22:51:10 EDT
  7. ; From: kaul@icarus.eng.ohio-state.edu (Rich Kaul)
  8. ; Subject: GNUS mail reading.
  9. ; Although I don't get as large a quantity of mail as you do, I still
  10. ; get a fair bit of mail.  As such, I have been looking into GNUS as a
  11. ; mail reader and have found I like it.  Because we don't have the
  12. ; source to a recent version of cshe around here and because I would
  13. ; rather have something a bit more portable for future reference I
  14. ; changed the pmd and make-active shell scripts you made into Bourne
  15. ; shell scripts.  Perhaps I should have made them bash scripts (it would
  16. ; have been easier), but they're sh scripts and they seem to work, at
  17. ; least on a Sun 3 running SunOS 4.0.3.  I did try and keep them as
  18. ; generic as possible, however.  I thought you might like them as a
  19. ; reference and porting base for others so I'm passing them along.
  20. ; I did make some changes in the scripts, however.  For example, the pmd
  21. ; script has a delivery function that decides whether the message
  22. ; destination is a directory, in which case it does the appropriate
  23. ; manipulations for GNUS reading, or a file, in which case it does the
  24. ; appropriate work for mail reading.  It's one of the key ways in which
  25. ; I filter my incoming mail.  As you can see from looking at it, there
  26. ; is only a small group of people who are able to send mail in
  27. ; /usr/spool/mail/kaul so only mail from that group of people is able to
  28. ; interrupt my working activity (advisors can be rather demanding about
  29. ; getting something done *now* so that their work can get out and people
  30. ; working for you also tend to have questions that need quick
  31. ; turn-around).  Further, the use of the key files is rather different
  32. ; than it was in your pmd, but that's a minor implementation difference.
  33. ; Comments are appreciated if you have any.  I'm glad that all I had to
  34. ; do was change some of the structure and logic of these and not write
  35. ; them from scratch.
  36. ; -rich
  37. ; #! /bin/sh
  38. ; # This is a shell archive.  Remove anything before this line, then unpack
  39. ; # it by saving it into a file and typing "sh file".  To overwrite existing
  40. ; # files, type "sh file -c".  You can also feed this as standard input via
  41. ; # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  42. ; # will see the following message at the end:
  43. ; #        "End of archive 1 (of 1)."
  44. ; # Contents:  make-active pmd
  45. ; # Wrapped by kaul@icarus.eng.ohio-state.edu on Thu Jul  5 22:39:58 1990
  46. ; PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  47. ; if test -f 'make-active' -a "${1}" != "-c" ; then 
  48. ;   echo shar: Will not clobber existing file \"'make-active'\"
  49. ; else
  50. ; echo shar: Extracting \"'make-active'\" \(819 characters\)
  51. ; sed "s/^X//" >'make-active' <<'END_OF_FILE'
  52. ; X#!/bin/sh
  53. ; X#
  54. ; X# Script to generate an active file for GNUS mail reading for Rich Kaul.
  55. ; X# Builds a shadow active file which represents personal mail under
  56. ; X# $1 plus a symlinks to the real news area.
  57. ; X
  58. ; Xdir=$1
  59. ; Xshift
  60. ; Xactive=$dir/active
  61. ; Xnactive=/usr/lib/news/active
  62. ; Xif [ $#argv -lt 1 ]; then
  63. ; X    echo make-active: usage: make-active directory subdirs...
  64. ; X    exit 87
  65. ; Xfi
  66. ; X
  67. ; X# Find directories and their associated .first and .last files.  Then
  68. ; X# take base dirnames, change to newsgroup name format, and build the
  69. ; X# mail-based active file out of it all.
  70. ; X
  71. ; Xcd $dir
  72. ; Xlist=$*
  73. ; Xcp /dev/null $active
  74. ; Xfor i in $list ; do
  75. ; X    first=`cat $i/.first`
  76. ; X    first=${first:=0}
  77. ; X    last=`cat $i/.last`
  78. ; X    last=${last:=0}
  79. ; X    nlist=`echo $i | tr / .`
  80. ; X    echo $nlist $last $first n >> $active
  81. ; Xdone
  82. ; X
  83. ; X# Now add the whole canonical active file,
  84. ; Xcat $nactive >> $active
  85. ; X
  86. ; Xexit 0
  87. ; END_OF_FILE
  88. ; if test 819 -ne `wc -c <'make-active'`; then
  89. ;     echo shar: \"'make-active'\" unpacked with wrong size!
  90. ; fi
  91. ; chmod +x 'make-active'
  92. ; # end of 'make-active'
  93. ; fi
  94. ; if test -f 'pmd' -a "${1}" != "-c" ; then 
  95. ;   echo shar: Will not clobber existing file \"'pmd'\"
  96. ; else
  97. ; echo shar: Extracting \"'pmd'\" \(1672 characters\)
  98. ; sed "s/^X//" >'pmd' <<'END_OF_FILE'
  99. ; X#!/bin/sh
  100. ; X#
  101. ; X# Personal mail delivery for Rich Kaul.  This version can use the GNUS
  102. ; X# news reader to read mail as if it were news, although that is not
  103. ; X# required.   I also have it set up so that only a few people can send
  104. ; X# me mail that will alert me to its arrival by depositing itself in
  105. ; X# /usr/spool/mail/kaul. 
  106. ; X 
  107. ; Xumask 077
  108. ; XPATH=/usr/local/bin:/usr/ucb:/bin:/usr/bin
  109. ; Xmail_dir=/usr/1/kaul/mail
  110. ; Xnews_dir=/usr/1/kaul/Memos/personal
  111. ; Xmailbox=/usr/spool/mail/kaul
  112. ; Xtmp=/usr/1/kaul/mail/kaul-$$
  113. ; X
  114. ; Xdeliver()
  115. ; X{
  116. ; X  keyf=$*.KEY
  117. ; X  retry=0
  118. ; X  while [ $retry -lt 20 -a -f $keyf ]
  119. ; X  do
  120. ; X     echo "Retry number $retry"
  121. ; X     sleep 10
  122. ; X     retry=`expr $retry + 1`
  123. ; X  done
  124. ; X
  125. ; X  # If we fall out to here without success, we failed 20 times to
  126. ; X  # get the key.  Result: Who cares?  We'll go forward anyway,
  127. ; X  # and re-assert the key when we're done.
  128. ; X  touch $keyf
  129. ; X  if [ -d $* ]; then
  130. ; X    seq=`cat $*/.last`
  131. ; X    seq=`expr $seq + 1`
  132. ; X    echo $seq > $*/.last
  133. ; X    sed -e '1s/^From /UNIX-From: /' < $tmp > $*/$seq
  134. ; X  else
  135. ; X    if [ -s $* ]; then
  136. ; X      echo '' >> $*
  137. ; X    fi
  138. ; X    sed -e '1s/^From: /From /' < $tmp >> $*
  139. ; X  fi
  140. ; X  rm -f $keyf
  141. ; X}
  142. ; X
  143. ; X
  144. ; X# Save the mail momentarily so we can work on it.
  145. ; Xcat - > $tmp
  146. ; X
  147. ; X# Deduce headers appropriately.
  148. ; Xfrom=`head -1 $tmp`
  149. ; X
  150. ; Xfrom=`echo "$from[2]" | sed -e 's/@.*//' -e 's/\(.*\)!\(.*\)/\2/'`
  151. ; Xcase $from in
  152. ; X  *[Ff][Ii][Rr][Ee][Aa][Rr][Mm][Ss]*)
  153. ; X    deliver $news_dir/firearms
  154. ; X  ;;
  155. ; X  *[Hh][Vv][Rr]*)
  156. ; X    deliver $news_dir/xview
  157. ; X  ;;
  158. ; X  *[Ff][Rr][Ee][Ee][Mm][Aa][Cc][Ss]*)
  159. ; X    deliver $news_dir/freemacs
  160. ; X  ;;
  161. ; X  bibyk | ken | monty | joe | wilson | orlando | gratz | zaka )
  162. ; X    deliver $mailbox
  163. ; X  ;;
  164. ; X  *)
  165. ; X    deliver $news_dir
  166. ; X  ;;
  167. ; Xesac
  168. ; X
  169. ; X# Clean up and exit
  170. ; Xrm -f $tmp
  171. ; Xexit 0
  172. ; END_OF_FILE
  173. ; if test 1672 -ne `wc -c <'pmd'`; then
  174. ;     echo shar: \"'pmd'\" unpacked with wrong size!
  175. ; fi
  176. ; chmod +x 'pmd'
  177. ; # end of 'pmd'
  178. ; fi
  179. ; echo shar: End of archive 1 \(of 1\).
  180. ; cp /dev/null ark1isdone
  181. ; MISSING=""
  182. ; for I in 1 ; do
  183. ;     if test ! -f ark${I}isdone ; then
  184. ;     MISSING="${MISSING} ${I}"
  185. ;     fi
  186. ; done
  187. ; if test "${MISSING}" = "" ; then
  188. ;     echo You have the archive.
  189. ;     rm -f ark[1-9]isdone
  190. ; else
  191. ;     echo You still need to unpack the following archives:
  192. ;     echo "        " ${MISSING}
  193. ; fi
  194. ; ##  End of shell archive.
  195. ; exit 0